diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/server/plugin.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts index 7ce376d13..1fbfd208f 100644 --- a/server/models/server/plugin.ts +++ b/server/models/server/plugin.ts | |||
@@ -42,7 +42,6 @@ export class PluginModel extends Model<PluginModel> { | |||
42 | uninstalled: boolean | 42 | uninstalled: boolean |
43 | 43 | ||
44 | @AllowNull(false) | 44 | @AllowNull(false) |
45 | @Is('PluginPeertubeEngine', value => throwIfNotValid(value, isPluginVersionValid, 'peertubeEngine')) | ||
46 | @Column | 45 | @Column |
47 | peertubeEngine: string | 46 | peertubeEngine: string |
48 | 47 | ||
@@ -76,4 +75,14 @@ export class PluginModel extends Model<PluginModel> { | |||
76 | return PluginModel.findAll(query) | 75 | return PluginModel.findAll(query) |
77 | } | 76 | } |
78 | 77 | ||
78 | static uninstall (pluginName: string) { | ||
79 | const query = { | ||
80 | where: { | ||
81 | name: pluginName | ||
82 | } | ||
83 | } | ||
84 | |||
85 | return PluginModel.update({ enabled: false, uninstalled: true }, query) | ||
86 | } | ||
87 | |||
79 | } | 88 | } |