aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/avatar
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/avatar')
-rw-r--r--server/models/avatar/avatar.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/models/avatar/avatar.ts b/server/models/avatar/avatar.ts
index 51e26c87b..5d73e24fa 100644
--- a/server/models/avatar/avatar.ts
+++ b/server/models/avatar/avatar.ts
@@ -1,9 +1,9 @@
1import { join } from 'path' 1import { join } from 'path'
2import { AfterDestroy, AllowNull, Column, CreatedAt, Model, Table, UpdatedAt } from 'sequelize-typescript' 2import { AfterDestroy, AllowNull, Column, CreatedAt, Model, Table, UpdatedAt } from 'sequelize-typescript'
3import { Avatar } from '../../../shared/models/avatars/avatar.model' 3import { Avatar } from '../../../shared/models/avatars/avatar.model'
4import { unlinkPromise } from '../../helpers/core-utils'
5import { CONFIG, STATIC_PATHS } from '../../initializers' 4import { CONFIG, STATIC_PATHS } from '../../initializers'
6import { logger } from '../../helpers/logger' 5import { logger } from '../../helpers/logger'
6import { remove } from 'fs-extra'
7 7
8@Table({ 8@Table({
9 tableName: 'avatar' 9 tableName: 'avatar'
@@ -40,6 +40,6 @@ export class AvatarModel extends Model<AvatarModel> {
40 40
41 removeAvatar () { 41 removeAvatar () {
42 const avatarPath = join(CONFIG.STORAGE.AVATARS_DIR, this.filename) 42 const avatarPath = join(CONFIG.STORAGE.AVATARS_DIR, this.filename)
43 return unlinkPromise(avatarPath) 43 return remove(avatarPath)
44 } 44 }
45} 45}