📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
fixed create extension
Blue Mouse00bbdd339701
diff --git a/src/marketplace/extensions/entities/extension.entity.ts b/src/marketplace/extensions/entities/extension.entity.tsindex 1ed92d780..28773878e 100644--- a/src/marketplace/extensions/entities/extension.entity.ts+++ b/src/marketplace/extensions/entities/extension.entity.ts@@ -53,8 +53,8 @@ export class Extension {@Column('simple-array')additionalImages: string[] | []- @Column('varchar')- fileURL: string+ @Column({ type: 'varchar', nullable: true, default: null })+ fileURL: string | null@CreateDateColumn()createdAt: Datediff --git a/src/marketplace/extensions/extensions.controller.ts b/src/marketplace/extensions/extensions.controller.tsindex bfd7cfc65..8148c4e98 100644--- a/src/marketplace/extensions/extensions.controller.ts+++ b/src/marketplace/extensions/extensions.controller.ts@@ -4,6 +4,7 @@ import {Controller,Delete,Get,+ InternalServerErrorException,Logger,NotFoundException,Param,@@ -312,6 +313,21 @@ export class ExtensionsController {})}+ let fileURL+ let mainImageURL++ try {+ fileURL = files.file && (await this.cdnService.uploadFile(files.file[0]))?.filename+ } catch (e) {+ throw new InternalServerErrorException('Failed to upload extension to the CDN.')+ }++ try {+ mainImageURL = files.mainImage && (await this.cdnService.uploadFile(files.mainImage[0]))?.filename+ } catch (e) {+ throw new InternalServerErrorException('Failed to upload main image to the CDN.')+ }+const user = await this.userService.findOne(userId)const extensionInstance = this.extensionsService.create({name: body.name,@@ -319,11 +335,9 @@ export class ExtensionsController {version: body.version,price: body.price,owner: user,- mainImage: files.mainImage- ? (await this.cdnService.uploadFile(files.mainImage[0]))?.filename- : undefined,- additionalImages: files.additionalImages ? additionalImageFilenames : [],- fileURL: (await this.cdnService.uploadFile(files.file[0]))?.filename,+ mainImage: mainImageURL,+ additionalImages: additionalImageFilenames,+ fileURL,categories: body.categoriesIds? await this.categoriesService.findByIds(body.categoriesIds): undefined,