Upload Workspace logo during onboarding (#542)

* Upload image

* Upload image

* Fix tests

* Remove pictures from seeds

* Fix storybook

* Fix storybook

* Fix storybook
This commit is contained in:
Charles Bochet
2023-07-08 16:46:04 -07:00
committed by GitHub
parent e03d5ed8a7
commit be7731b71a
22 changed files with 226 additions and 41 deletions

View File

@ -3,7 +3,6 @@ import { createReadStream, existsSync } from 'fs';
import { join, dirname } from 'path';
import { StorageDriver } from './interfaces/storage-driver.interface';
import { Readable } from 'stream';
import { kebabCase } from 'src/utils/kebab-case';
export interface LocalDriverOptions {
storagePath: string;
@ -32,7 +31,7 @@ export class LocalDriver implements StorageDriver {
}): Promise<void> {
const filePath = join(
`${this.options.storagePath}/`,
kebabCase(params.folder),
params.folder,
params.name,
);
const folderPath = dirname(filePath);

View File

@ -9,7 +9,6 @@ import {
} from '@aws-sdk/client-s3';
import { StorageDriver } from './interfaces/storage-driver.interface';
import { Readable } from 'stream';
import { kebabCase } from 'src/utils/kebab-case';
export interface S3DriverOptions extends S3ClientConfig {
bucketName: string;
@ -42,7 +41,7 @@ export class S3Driver implements StorageDriver {
mimeType: string | undefined;
}): Promise<void> {
const command = new PutObjectCommand({
Key: `${kebabCase(params.folder)}/${params.name}`,
Key: `${params.folder}/${params.name}`,
Body: params.file,
ContentType: params.mimeType,
Bucket: this.bucketName,