mirror of
https://github.com/hexastack/hexabot
synced 2025-01-22 10:35:37 +00:00
fix: apply review feedback
This commit is contained in:
parent
81aed2e5db
commit
6a4746dccd
@ -61,7 +61,7 @@ export class AttachmentService extends BaseService<Attachment> {
|
||||
const storageHelper = await this.helperService.getDefaultHelper(
|
||||
HelperType.STORAGE,
|
||||
);
|
||||
return storageHelper.download(attachment);
|
||||
return await storageHelper.download(attachment);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -74,7 +74,7 @@ export class AttachmentService extends BaseService<Attachment> {
|
||||
const storageHelper = await this.helperService.getDefaultHelper(
|
||||
HelperType.STORAGE,
|
||||
);
|
||||
return storageHelper.readAsBuffer(attachment);
|
||||
return await storageHelper.readAsBuffer(attachment);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -775,7 +775,12 @@ const migrateAndPopulateAttachmentMessages = async ({
|
||||
const addDefaultStorageHelper = async ({ logger }: MigrationServices) => {
|
||||
const SettingModel = mongoose.model<Setting>(Setting.name, settingSchema);
|
||||
try {
|
||||
await SettingModel.create({
|
||||
await SettingModel.updateOne(
|
||||
{
|
||||
group: 'chatbot_settings',
|
||||
label: 'default_storage_helper',
|
||||
},
|
||||
{
|
||||
group: 'chatbot_settings',
|
||||
label: 'default_storage_helper',
|
||||
value: 'local-storage-helper',
|
||||
@ -788,7 +793,11 @@ const addDefaultStorageHelper = async ({ logger }: MigrationServices) => {
|
||||
labelKey: 'name',
|
||||
},
|
||||
weight: 2,
|
||||
});
|
||||
},
|
||||
{
|
||||
upsert: true,
|
||||
},
|
||||
);
|
||||
logger.log('Successfuly added the default local storage helper setting');
|
||||
} catch (err) {
|
||||
logger.error('Unable to add the default local storage helper setting');
|
||||
|
Loading…
Reference in New Issue
Block a user