refactor(base): rename baseId to pageId in BaseViewService

This commit is contained in:
Philipinho
2026-04-27 01:20:34 +01:00
parent fdb250bbe8
commit 42f950e11d
@@ -42,7 +42,7 @@ export class BaseViewService {
const position = generateJitteredKeyBetween(lastPosition, null); const position = generateJitteredKeyBetween(lastPosition, null);
const created = await this.baseViewRepo.insertView({ const created = await this.baseViewRepo.insertView({
baseId: dto.baseId, pageId: dto.baseId,
name: dto.name, name: dto.name,
type: dto.type ?? 'table', type: dto.type ?? 'table',
position, position,
@@ -69,7 +69,7 @@ export class BaseViewService {
throw new NotFoundException('View not found'); throw new NotFoundException('View not found');
} }
if (view.baseId !== dto.baseId) { if (view.pageId !== dto.baseId) {
throw new BadRequestException('View does not belong to this base'); throw new BadRequestException('View does not belong to this base');
} }
@@ -119,11 +119,11 @@ export class BaseViewService {
throw new NotFoundException('View not found'); throw new NotFoundException('View not found');
} }
if (view.baseId !== dto.baseId) { if (view.pageId !== dto.baseId) {
throw new BadRequestException('View does not belong to this base'); throw new BadRequestException('View does not belong to this base');
} }
const viewCount = await this.baseViewRepo.countByBaseId(dto.baseId, { const viewCount = await this.baseViewRepo.countByPageId(dto.baseId, {
workspaceId, workspaceId,
}); });
if (viewCount <= 1) { if (viewCount <= 1) {
@@ -142,7 +142,7 @@ export class BaseViewService {
this.eventEmitter.emit(EventName.BASE_VIEW_DELETED, event); this.eventEmitter.emit(EventName.BASE_VIEW_DELETED, event);
} }
async listByBaseId(baseId: string, workspaceId: string) { async listByBaseId(pageId: string, workspaceId: string) {
return this.baseViewRepo.findByBaseId(baseId, { workspaceId }); return this.baseViewRepo.findByPageId(pageId, { workspaceId });
} }
} }