update CustomEmojiService.ts
update add-request.ts update delete.ts update DriveFileEntityService.ts update update-request.ts update update.ts Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
This commit is contained in:
parent
1a6f0026e6
commit
1ed0e7e8a3
6 changed files with 9 additions and 12 deletions
|
|
@ -60,7 +60,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
|||
}
|
||||
|
||||
@bindThis
|
||||
public async Request(data: {
|
||||
public async request(data: {
|
||||
driveFile: MiDriveFile;
|
||||
name: string;
|
||||
category: string | null;
|
||||
|
|
@ -196,7 +196,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
|||
}
|
||||
}
|
||||
@bindThis
|
||||
public async RequestUpdate(id: MiEmoji['id'], data: {
|
||||
public async updateRequest(id: MiEmoji['id'], data: {
|
||||
driveFile?: MiDriveFile;
|
||||
name?: string;
|
||||
category?: string | null;
|
||||
|
|
@ -332,7 +332,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
|||
}
|
||||
}
|
||||
@bindThis
|
||||
public async RequestDelete(id: MiEmojiRequest['id']) {
|
||||
public async deleteRequest(id: MiEmojiRequest['id']) {
|
||||
const emoji = await this.emojiRequestsRepository.findOneByOrFail({ id: id });
|
||||
|
||||
await this.emojiRequestsRepository.delete(emoji.id);
|
||||
|
|
|
|||
|
|
@ -135,10 +135,7 @@ export class DriveFileEntityService {
|
|||
}
|
||||
@bindThis
|
||||
public async getFromUrl(url: string): Promise<MiDriveFile | null> {
|
||||
const file = await this.driveFilesRepository.findOneBy({ url: url });
|
||||
if (file === null ) return null;
|
||||
|
||||
return file;
|
||||
return this.driveFilesRepository.findOneBy({ url: url });
|
||||
}
|
||||
@bindThis
|
||||
public async calcDriveUsageOf(user: MiUser['id'] | { id: MiUser['id'] }): Promise<number> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue