feat(rfid): front end view of the readers and there status

This commit is contained in:
2025-07-10 21:29:01 -05:00
parent 6584b37cb0
commit f7b4de8130
15 changed files with 533 additions and 36 deletions

View File

@@ -0,0 +1,21 @@
import { db } from "../../../../database/dbclient.js";
import { rfidReaders } from "../../../../database/schema/rfidReaders.js";
import { returnRes } from "../../../globalUtils/routeDefs/returnRes.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";
export const getReaders = async () => {
const { data, error } = await tryCatch(db.select().from(rfidReaders));
if (error) {
return returnRes(
false,
"There was an error getting the Readers",
"rfid",
"rfid",
"error",
error
);
}
return returnRes(true, "Current readers", "rfid", "rfid", "info", data);
};