mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
refactor(base): drop /list suffix from base endpoints to match codebase convention
This commit is contained in:
@@ -71,7 +71,7 @@ export async function listBases(
|
|||||||
spaceId: string,
|
spaceId: string,
|
||||||
params?: { cursor?: string; limit?: number },
|
params?: { cursor?: string; limit?: number },
|
||||||
): Promise<IPagination<IBase>> {
|
): Promise<IPagination<IBase>> {
|
||||||
const req = await api.post("/bases/list", { spaceId, ...params });
|
const req = await api.post("/bases", { spaceId, ...params });
|
||||||
return req.data;
|
return req.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ export async function listRows(
|
|||||||
search?: SearchSpec;
|
search?: SearchSpec;
|
||||||
},
|
},
|
||||||
): Promise<IPagination<IBaseRow>> {
|
): Promise<IPagination<IBaseRow>> {
|
||||||
const req = await api.post("/bases/rows/list", { baseId, ...params });
|
const req = await api.post("/bases/rows", { baseId, ...params });
|
||||||
return req.data;
|
return req.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,6 +168,6 @@ export async function deleteView(data: DeleteViewInput): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function listViews(baseId: string): Promise<IBaseView[]> {
|
export async function listViews(baseId: string): Promise<IBaseView[]> {
|
||||||
const req = await api.post<IBaseView[]>("/bases/views/list", { baseId });
|
const req = await api.post<IBaseView[]>("/bases/views", { baseId });
|
||||||
return req.data;
|
return req.data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ export class BaseRowController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@HttpCode(HttpStatus.OK)
|
@HttpCode(HttpStatus.OK)
|
||||||
@Post('list')
|
@Post()
|
||||||
async list(
|
async list(
|
||||||
@Body() dto: ListRowsDto,
|
@Body() dto: ListRowsDto,
|
||||||
@Body() pagination: PaginationOptions,
|
@Body() pagination: PaginationOptions,
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export class BaseViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@HttpCode(HttpStatus.OK)
|
@HttpCode(HttpStatus.OK)
|
||||||
@Post('list')
|
@Post()
|
||||||
async list(
|
async list(
|
||||||
@Body() dto: BaseIdDto,
|
@Body() dto: BaseIdDto,
|
||||||
@AuthUser() user: User,
|
@AuthUser() user: User,
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export class BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@HttpCode(HttpStatus.OK)
|
@HttpCode(HttpStatus.OK)
|
||||||
@Post('list')
|
@Post()
|
||||||
async list(
|
async list(
|
||||||
@Body() dto: SpaceIdDto,
|
@Body() dto: SpaceIdDto,
|
||||||
@Body() pagination: PaginationOptions,
|
@Body() pagination: PaginationOptions,
|
||||||
|
|||||||
Reference in New Issue
Block a user