Skip to content

Commit 8d13e08

Browse files
committed
fix: correct attachment location type
1 parent 67ba322 commit 8d13e08

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

plugins/qeta-backend/src/upload/database.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ class DatabaseStoreEngine {
1313
database: QetaStore;
1414
backendBaseUrl: string;
1515
qetaUrl: string;
16-
storageType: string;
1716

1817
constructor(opts: Options) {
1918
this.config = opts.config;
2019
this.database = opts.database;
2120
this.backendBaseUrl = this.config.getString('backend.baseUrl');
2221
this.qetaUrl = `${this.backendBaseUrl}/api/qeta/attachments`;
23-
this.storageType =
24-
this.config.getOptionalString('qeta.storage.type') || 'filesystem';
2522
}
2623

2724
handleFile = async (file: File) => {
@@ -30,7 +27,7 @@ class DatabaseStoreEngine {
3027

3128
const attachment = await this.database.postAttachment({
3229
uuid: imageUuid,
33-
locationType: this.storageType,
30+
locationType: 'database',
3431
locationUri: locationUri,
3532
extension: file.ext,
3633
mimeType: file.mimeType,

plugins/qeta-backend/src/upload/filesystem.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@ class FilesystemStoreEngine {
1414
database: QetaStore;
1515
backendBaseUrl: string;
1616
qetaUrl: string;
17-
storageType: string;
1817
folder: string;
1918

2019
constructor(opts: Options) {
2120
this.config = opts.config;
2221
this.database = opts.database;
2322
this.backendBaseUrl = this.config.getString('backend.baseUrl');
2423
this.qetaUrl = `${this.backendBaseUrl}/api/qeta/attachments`;
25-
this.storageType =
26-
this.config.getOptionalString('qeta.storage.type') || 'filesystem';
2724
this.folder =
2825
this.config.getOptionalString('qeta.storage.folder') ||
2926
'/tmp/backstage-qeta-images';
@@ -45,7 +42,7 @@ class FilesystemStoreEngine {
4542

4643
const attachment = await this.database.postAttachment({
4744
uuid: imageUuid,
48-
locationType: this.storageType,
45+
locationType: 'filesystem',
4946
locationUri: imageURI,
5047
extension: file.ext,
5148
path: newPath,

0 commit comments

Comments
 (0)