Ship legacy migrate APIs, portfolio/blog old-id schema, and admin migrate/purge flows.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
7244b70e90
commit
4598add88c
@@ -12,6 +12,7 @@ import sharp from 'sharp';
|
||||
import { AuthUser } from '../auth/auth.types';
|
||||
import { PermissionsService } from '../auth/permissions.service';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
import { businessMediaKey } from '../storage/storage-keys';
|
||||
import { StorageService } from '../storage/storage.service';
|
||||
import { ListMediaDto } from './dto/list-media.dto';
|
||||
import { UpdateMediaDto } from './dto/update-media.dto';
|
||||
@@ -92,7 +93,7 @@ export class MediaService {
|
||||
|
||||
const items = [];
|
||||
for (const file of files) {
|
||||
items.push(await this.uploadOne(businessId, business.slug, file, actor.id));
|
||||
items.push(await this.uploadOne(businessId, file, actor.id));
|
||||
}
|
||||
|
||||
return { items };
|
||||
@@ -153,7 +154,6 @@ export class MediaService {
|
||||
|
||||
private async uploadOne(
|
||||
businessId: bigint,
|
||||
businessSlug: string,
|
||||
file: Express.Multer.File,
|
||||
uploadedBy: bigint,
|
||||
) {
|
||||
@@ -201,7 +201,7 @@ export class MediaService {
|
||||
|
||||
const ext = this.extensionFromContentType(contentType);
|
||||
const fileName = `${randomUUID()}${ext}`;
|
||||
const storageKey = `businesses/${businessSlug}/${businessId}/media/${fileName}`;
|
||||
const storageKey = businessMediaKey(businessId, fileName);
|
||||
|
||||
const stored = await this.storage.upload({
|
||||
key: storageKey,
|
||||
|
||||
Reference in New Issue
Block a user