getAccounts added delete time

This commit is contained in:
jusax23 2023-04-06 14:02:43 +02:00
parent 76d314ec00
commit b70527032e
Signed by: jusax23
GPG key ID: 499E2AA870C1CD41

View file

@ -17,6 +17,7 @@ export const getAccounts: Act = {
accounts.name,
accounts.viewable,
accounts.deleted,
accounts.deletedTime,
accounts.maxRooms,
accounts.maxRoomSize,
accounts.maxUsersPerRoom
@ -28,11 +29,12 @@ export const getAccounts: Act = {
let name = d[accounts.name];
let viewable = d[accounts.viewable] ? true : false;
let deleted = d[accounts.deleted] ? true : false;
let deletedTime = Number(d[accounts.deletedTime]);
let maxRooms = d[accounts.maxRooms];
let maxRoomSize = d[accounts.maxRoomSize];
let maxUsersPerRoom = d[accounts.maxUsersPerRoom];
if (accID != null && rights != null && name != null && viewable != null && deleted != null && maxRooms != null && maxRoomSize != null && maxUsersPerRoom != null) {
return { accID, rights, name, viewable, deleted, maxRooms, maxRoomSize, maxUsersPerRoom };
if (accID != null && rights != null && name != null && viewable != null && deleted != null && maxRooms != null && maxRoomSize != null && maxUsersPerRoom != null && deletedTime != null) {
return { accID, rights, name, viewable, deleted, deletedTime, maxRooms, maxRoomSize, maxUsersPerRoom };
}
return null;
});
@ -150,7 +152,7 @@ export const addOTA: Act = { // or change it, primary key is the token
let resp = await insert(signupOTA.token, signupOTA.expires, signupOTA.usesLeft)
.add(data.token, data.expires, data.usesLeft)
.query(db);
if(resp.affectedRows == 0) throw new Error("insertion fail");
if (resp.affectedRows == 0) throw new Error("insertion fail");
} catch (error) {
await update(signupOTA)
.set(signupOTA.expires, data.expires)