mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-11-01 09:31:18 +01:00
23 lines
382 B
JavaScript
23 lines
382 B
JavaScript
|
import db from "./db";
|
||
|
|
||
|
class UserManager {
|
||
|
async all() {
|
||
|
return db.users.toArray();
|
||
|
}
|
||
|
|
||
|
async get(baseUrl) {
|
||
|
return db.users.get(baseUrl);
|
||
|
}
|
||
|
|
||
|
async save(user) {
|
||
|
await db.users.put(user);
|
||
|
}
|
||
|
|
||
|
async delete(baseUrl) {
|
||
|
await db.users.delete(baseUrl);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const userManager = new UserManager();
|
||
|
export default userManager;
|