wip
This commit is contained in:
parent
4cfe4993a1
commit
d8e1caa6cf
7 changed files with 185 additions and 38 deletions
|
@ -3,10 +3,10 @@
|
|||
* @author Xeltica
|
||||
*/
|
||||
|
||||
import { Body, CurrentUser, Get, JsonController, OnUndefined, Post, Put } from 'routing-controllers';
|
||||
import { Body, CurrentUser, Delete, Get, JsonController, OnUndefined, Post, Put } from 'routing-controllers';
|
||||
import { DeepPartial } from 'typeorm';
|
||||
import { getScores } from '../functions/get-scores';
|
||||
import { updateUser } from '../functions/users';
|
||||
import { deleteUser, updateUser } from '../functions/users';
|
||||
import { User } from '../models/entities/user';
|
||||
import { sendAlert } from '../services/send-alert';
|
||||
import { UserSetting } from './UserSetting';
|
||||
|
@ -38,6 +38,11 @@ export class SessionController {
|
|||
@Post('/alert') async testAlert(@CurrentUser({ required: true }) user: User) {
|
||||
await sendAlert(user);
|
||||
}
|
||||
|
||||
@OnUndefined(204)
|
||||
@Delete() async delete(@CurrentUser({ required: true }) user: User) {
|
||||
await deleteUser(user.username, user.host);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue