aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/avatar/avatar.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-27 16:23:34 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 16:23:34 +0200
commit62689b942b71cd1dd0d050c6ed05f884a0b325c2 (patch)
treec45c35d35d7a3e32621fba06edc63646930c8efd /server/models/avatar/avatar.ts
parent84b6dbcc6e8654f39ec798905e1151ba915cd1aa (diff)
downloadPeerTube-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.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}