fix error2
This commit is contained in:
@@ -70,7 +70,7 @@ export default function DevicesPage() {
|
||||
// فراخوانی API برای بررسی دستگاه
|
||||
const device = await api.CheckDevice(currentDeviceName.trim(), currentPassword.trim())
|
||||
|
||||
if (device) {
|
||||
if (device !=undefined) {
|
||||
setSelected(device)
|
||||
} else {
|
||||
setError('دستگاه یافت نشد یا رمز عبور نادرست است')
|
||||
|
||||
@@ -58,7 +58,7 @@ async function http<T>(url: string, init?: RequestInit): Promise<T> {
|
||||
}
|
||||
|
||||
export const api = {
|
||||
CheckDevice: (deviceName: string, password: string) => http<boolean>(`${API_BASE}/api/devices/CheckDevice?deviceName=${deviceName}&password=${password}`),
|
||||
CheckDevice: (deviceName: string, password: string) => http<DeviceDto>(`${API_BASE}/api/devices/CheckDevice?deviceName=${deviceName}&password=${password}`),
|
||||
listDevices: () => http<DeviceDto[]>(`${API_BASE}/api/devices`),
|
||||
createDevice: (dto: DeviceDto) => http<number>(`${API_BASE}/api/devices`, { method: 'POST', body: JSON.stringify(dto) }),
|
||||
listTelemetry: (q: { deviceId?: number; startUtc?: string; endUtc?: string; page?: number; pageSize?: number }) => {
|
||||
|
||||
Reference in New Issue
Block a user