diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-27 16:23:34 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 16:23:34 +0200 |
commit | 62689b942b71cd1dd0d050c6ed05f884a0b325c2 (patch) | |
tree | c45c35d35d7a3e32621fba06edc63646930c8efd /server/models/avatar/avatar.ts | |
parent | 84b6dbcc6e8654f39ec798905e1151ba915cd1aa (diff) | |
download | PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.gz PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.zst PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.zip |
Correctly migrate to fs-extra
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 | } |