control device

This commit is contained in:
2024-06-20 17:20:22 +07:00
parent 49d37ee7e1
commit 7b9935585a
4 changed files with 142 additions and 88 deletions

View File

@@ -50,4 +50,14 @@ export class DeviceService {
});
return this.http.get<any>(url, { headers });
}
deviceSwitch(data): Observable<any> {
const endpoint = `/devices`;
const url = `${BASE_URL}${endpoint}/device-switch`;
const headers = new HttpHeaders({
"Content-Type": "application/json",
"x-api-key": "j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT",
});
return this.http.post<any>(url, data, { headers });
}
}