update backend interfaces

This commit is contained in:
2024-04-03 20:03:31 +00:00
parent 6c984a7886
commit 69318a2dad
2 changed files with 26 additions and 25 deletions

View File

@@ -35,13 +35,13 @@ export default class LocalDB extends DB_BACKEND {
writeFileSync(this.#path, JSON.stringify(this.#data));
}
addUser (username, config = null) {
config = config || this.#defaultuser;
this.#data.users[username] = config;
addUser (username, attributes, params = null) {
attributes = attributes || this.#defaultuser;
this.#data.users[username] = attributes;
this.#save();
}
getUser (username) {
getUser (username, params = null) {
if (this.#data.users[username]) {
return this.#data.users[username];
}
@@ -50,9 +50,9 @@ export default class LocalDB extends DB_BACKEND {
}
}
setUser (username, config) {
setUser (username, attributes, params = null) {
if (this.#data.users[username]) {
this.#data.users[username] = config;
this.#data.users[username] = attributes;
this.#save();
return true;
}
@@ -61,7 +61,7 @@ export default class LocalDB extends DB_BACKEND {
}
}
delUser (username) {
delUser (username, params = null) {
if (this.#data.users[username]) {
delete this.#data.users[username];
this.#save();