1.0.0
This commit is contained in:
parent
a0f6dabbdf
commit
f06fcc2056
17 changed files with 194 additions and 25 deletions
|
@ -1,5 +1,6 @@
|
|||
import { User } from './models/entities/user';
|
||||
import { Users } from './models';
|
||||
import { DeepPartial } from 'typeorm';
|
||||
|
||||
export const getUser = (username: string, host: string): Promise<User | undefined> => {
|
||||
return Users.findOne({ username, host });
|
||||
|
@ -14,6 +15,10 @@ export const upsertUser = async (username: string, host: string, token: string):
|
|||
}
|
||||
};
|
||||
|
||||
export const updateUser = async (username: string, host: string, record: DeepPartial<User>): Promise<void> => {
|
||||
await Users.update({ username, host }, record);
|
||||
};
|
||||
|
||||
export const deleteUser = async (username: string, host: string): Promise<void> => {
|
||||
await Users.delete({ username, host });
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue