|
|
@@ -97,6 +97,13 @@ module.exports = function(crowi) {
|
|
|
// retrieve data from DB to get a completely populated instance
|
|
|
const attachment = await this.findById(id);
|
|
|
await fileUploader.deleteFile(attachment);
|
|
|
+ const User = await crowi.model('User');
|
|
|
+ await User.update({ imageAttachment: id }, {
|
|
|
+ $set: {
|
|
|
+ imageAttachment: undefined,
|
|
|
+ },
|
|
|
+ }, { multi: true });
|
|
|
+
|
|
|
return await attachment.remove();
|
|
|
};
|
|
|
|