Svelte UI Update
This commit is contained in:
29
api/controller/device.log.controller.js
Normal file
29
api/controller/device.log.controller.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const configs = require("../configs");
|
||||
const Library = require("../library");
|
||||
|
||||
const logSave = async (
|
||||
token,
|
||||
device_id,
|
||||
remote_name,
|
||||
remote_type,
|
||||
operating_type
|
||||
) => {
|
||||
if (token === configs.verifyToken) {
|
||||
try {
|
||||
const result = await Library.saveDeviceLog(
|
||||
device_id,
|
||||
remote_name,
|
||||
remote_type,
|
||||
operating_type
|
||||
);
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
throw new Error("Mongodb'ye kaydedilirken hata oluştu (log.controller)");
|
||||
}
|
||||
} else {
|
||||
throw new Error("Hatalı token (log.controller)");
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { logSave };
|
||||
Reference in New Issue
Block a user