diff options
Diffstat (limited to 'server/models/avatar/avatar.ts')
-rw-r--r-- | server/models/avatar/avatar.ts | 4 |
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 @@ | |||
1 | import { join } from 'path' | 1 | import { join } from 'path' |
2 | import { AfterDestroy, AllowNull, Column, CreatedAt, Model, Table, UpdatedAt } from 'sequelize-typescript' | 2 | import { AfterDestroy, AllowNull, Column, CreatedAt, Model, Table, UpdatedAt } from 'sequelize-typescript' |
3 | import { Avatar } from '../../../shared/models/avatars/avatar.model' | 3 | import { Avatar } from '../../../shared/models/avatars/avatar.model' |
4 | import { unlinkPromise } from '../../helpers/core-utils' | ||
5 | import { CONFIG, STATIC_PATHS } from '../../initializers' | 4 | import { CONFIG, STATIC_PATHS } from '../../initializers' |
6 | import { logger } from '../../helpers/logger' | 5 | import { logger } from '../../helpers/logger' |
6 | import { 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 | } |