mirror of
https://github.com/docmost/docmost.git
synced 2026-08-30 02:25:01 +08:00
refactor(base): rename baseId to pageId in client services and queries
This commit is contained in:
@@ -26,7 +26,7 @@ export function useCreatePropertyMutation() {
|
|||||||
mutationFn: (data) => createProperty(data),
|
mutationFn: (data) => createProperty(data),
|
||||||
onSuccess: (newProperty) => {
|
onSuccess: (newProperty) => {
|
||||||
queryClient.setQueryData<IBase>(
|
queryClient.setQueryData<IBase>(
|
||||||
["bases", newProperty.baseId],
|
["bases", newProperty.pageId],
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -51,7 +51,7 @@ export function useUpdatePropertyMutation() {
|
|||||||
mutationFn: (data) => updateProperty(data),
|
mutationFn: (data) => updateProperty(data),
|
||||||
onSuccess: (result, variables) => {
|
onSuccess: (result, variables) => {
|
||||||
queryClient.setQueryData<IBase>(
|
queryClient.setQueryData<IBase>(
|
||||||
["bases", variables.baseId],
|
["bases", variables.pageId],
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -78,7 +78,7 @@ export function useDeletePropertyMutation() {
|
|||||||
mutationFn: (data) => deleteProperty(data),
|
mutationFn: (data) => deleteProperty(data),
|
||||||
onSuccess: (_, variables) => {
|
onSuccess: (_, variables) => {
|
||||||
queryClient.setQueryData<IBase>(
|
queryClient.setQueryData<IBase>(
|
||||||
["bases", variables.baseId],
|
["bases", variables.pageId],
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -91,7 +91,7 @@ export function useDeletePropertyMutation() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
||||||
{ queryKey: ["base-rows", variables.baseId] },
|
{ queryKey: ["base-rows", variables.pageId] },
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -123,16 +123,16 @@ export function useReorderPropertyMutation() {
|
|||||||
mutationFn: (data) => reorderProperty(data),
|
mutationFn: (data) => reorderProperty(data),
|
||||||
onMutate: async (variables) => {
|
onMutate: async (variables) => {
|
||||||
await queryClient.cancelQueries({
|
await queryClient.cancelQueries({
|
||||||
queryKey: ["bases", variables.baseId],
|
queryKey: ["bases", variables.pageId],
|
||||||
});
|
});
|
||||||
|
|
||||||
const previous = queryClient.getQueryData<IBase>([
|
const previous = queryClient.getQueryData<IBase>([
|
||||||
"bases",
|
"bases",
|
||||||
variables.baseId,
|
variables.pageId,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
queryClient.setQueryData<IBase>(
|
queryClient.setQueryData<IBase>(
|
||||||
["bases", variables.baseId],
|
["bases", variables.pageId],
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -151,7 +151,7 @@ export function useReorderPropertyMutation() {
|
|||||||
onError: (_, variables, context) => {
|
onError: (_, variables, context) => {
|
||||||
if (context?.previous) {
|
if (context?.previous) {
|
||||||
queryClient.setQueryData(
|
queryClient.setQueryData(
|
||||||
["bases", variables.baseId],
|
["bases", variables.pageId],
|
||||||
context.previous,
|
context.previous,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ import { queryClient } from "@/main";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export function useBaseQuery(
|
export function useBaseQuery(
|
||||||
baseId: string | undefined,
|
pageId: string | undefined,
|
||||||
): UseQueryResult<IBase, Error> {
|
): UseQueryResult<IBase, Error> {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ["bases", baseId],
|
queryKey: ["bases", pageId],
|
||||||
queryFn: () => getBaseInfo(baseId!),
|
queryFn: () => getBaseInfo(pageId!),
|
||||||
enabled: !!baseId,
|
enabled: !!pageId,
|
||||||
staleTime: 5 * 60 * 1000,
|
staleTime: 5 * 60 * 1000,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -68,10 +68,10 @@ export function useUpdateBaseMutation() {
|
|||||||
|
|
||||||
export function useDeleteBaseMutation() {
|
export function useDeleteBaseMutation() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return useMutation<void, Error, { baseId: string; spaceId: string }>({
|
return useMutation<void, Error, { pageId: string; spaceId: string }>({
|
||||||
mutationFn: ({ baseId }) => deleteBase(baseId),
|
mutationFn: ({ pageId }) => deleteBase(pageId),
|
||||||
onSuccess: (_, { baseId, spaceId }) => {
|
onSuccess: (_, { pageId, spaceId }) => {
|
||||||
queryClient.removeQueries({ queryKey: ["bases", baseId] });
|
queryClient.removeQueries({ queryKey: ["bases", pageId] });
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: ["bases", "list", spaceId],
|
queryKey: ["bases", "list", spaceId],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ function newRequestId(): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function useBaseRowsQuery(
|
export function useBaseRowsQuery(
|
||||||
baseId: string | undefined,
|
pageId: string | undefined,
|
||||||
filter?: FilterNode,
|
filter?: FilterNode,
|
||||||
sorts?: ViewSortConfig[],
|
sorts?: ViewSortConfig[],
|
||||||
search?: SearchSpec,
|
search?: SearchSpec,
|
||||||
@@ -69,16 +69,16 @@ export function useBaseRowsQuery(
|
|||||||
const activeSearch = search?.query ? search : undefined;
|
const activeSearch = search?.query ? search : undefined;
|
||||||
|
|
||||||
return useInfiniteQuery({
|
return useInfiniteQuery({
|
||||||
queryKey: ["base-rows", baseId, activeFilter, activeSorts, activeSearch],
|
queryKey: ["base-rows", pageId, activeFilter, activeSorts, activeSearch],
|
||||||
queryFn: ({ pageParam }) =>
|
queryFn: ({ pageParam }) =>
|
||||||
listRows(baseId!, {
|
listRows(pageId!, {
|
||||||
cursor: pageParam,
|
cursor: pageParam,
|
||||||
limit: 100,
|
limit: 100,
|
||||||
filter: activeFilter,
|
filter: activeFilter,
|
||||||
sorts: activeSorts,
|
sorts: activeSorts,
|
||||||
search: activeSearch,
|
search: activeSearch,
|
||||||
}),
|
}),
|
||||||
enabled: !!baseId,
|
enabled: !!pageId,
|
||||||
initialPageParam: undefined as string | undefined,
|
initialPageParam: undefined as string | undefined,
|
||||||
getNextPageParam: (lastPage: IPagination<IBaseRow>) =>
|
getNextPageParam: (lastPage: IPagination<IBaseRow>) =>
|
||||||
lastPage.meta?.nextCursor ?? undefined,
|
lastPage.meta?.nextCursor ?? undefined,
|
||||||
@@ -99,7 +99,7 @@ export function useCreateRowMutation() {
|
|||||||
mutationFn: (data) => createRow({ ...data, requestId: newRequestId() }),
|
mutationFn: (data) => createRow({ ...data, requestId: newRequestId() }),
|
||||||
onSuccess: (newRow) => {
|
onSuccess: (newRow) => {
|
||||||
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
||||||
{ queryKey: ["base-rows", newRow.baseId] },
|
{ queryKey: ["base-rows", newRow.pageId] },
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
const lastPageIndex = old.pages.length - 1;
|
const lastPageIndex = old.pages.length - 1;
|
||||||
@@ -130,15 +130,15 @@ export function useUpdateRowMutation() {
|
|||||||
mutationFn: (data) => updateRow({ ...data, requestId: newRequestId() }),
|
mutationFn: (data) => updateRow({ ...data, requestId: newRequestId() }),
|
||||||
onMutate: async (variables) => {
|
onMutate: async (variables) => {
|
||||||
await queryClient.cancelQueries({
|
await queryClient.cancelQueries({
|
||||||
queryKey: ["base-rows", variables.baseId],
|
queryKey: ["base-rows", variables.pageId],
|
||||||
});
|
});
|
||||||
|
|
||||||
const snapshots = queryClient.getQueriesData<
|
const snapshots = queryClient.getQueriesData<
|
||||||
InfiniteData<IPagination<IBaseRow>>
|
InfiniteData<IPagination<IBaseRow>>
|
||||||
>({ queryKey: ["base-rows", variables.baseId] });
|
>({ queryKey: ["base-rows", variables.pageId] });
|
||||||
|
|
||||||
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
||||||
{ queryKey: ["base-rows", variables.baseId] },
|
{ queryKey: ["base-rows", variables.pageId] },
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -173,7 +173,7 @@ export function useUpdateRowMutation() {
|
|||||||
},
|
},
|
||||||
onSuccess: (updatedRow) => {
|
onSuccess: (updatedRow) => {
|
||||||
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
||||||
{ queryKey: ["base-rows", updatedRow.baseId] },
|
{ queryKey: ["base-rows", updatedRow.pageId] },
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -199,15 +199,15 @@ export function useDeleteRowMutation() {
|
|||||||
mutationFn: (data) => deleteRow({ ...data, requestId: newRequestId() }),
|
mutationFn: (data) => deleteRow({ ...data, requestId: newRequestId() }),
|
||||||
onMutate: async (variables) => {
|
onMutate: async (variables) => {
|
||||||
await queryClient.cancelQueries({
|
await queryClient.cancelQueries({
|
||||||
queryKey: ["base-rows", variables.baseId],
|
queryKey: ["base-rows", variables.pageId],
|
||||||
});
|
});
|
||||||
|
|
||||||
const snapshots = queryClient.getQueriesData<
|
const snapshots = queryClient.getQueriesData<
|
||||||
InfiniteData<IPagination<IBaseRow>>
|
InfiniteData<IPagination<IBaseRow>>
|
||||||
>({ queryKey: ["base-rows", variables.baseId] });
|
>({ queryKey: ["base-rows", variables.pageId] });
|
||||||
|
|
||||||
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
||||||
{ queryKey: ["base-rows", variables.baseId] },
|
{ queryKey: ["base-rows", variables.pageId] },
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -242,16 +242,16 @@ export function useDeleteRowsMutation() {
|
|||||||
mutationFn: (data) => deleteRows({ ...data, requestId: newRequestId() }),
|
mutationFn: (data) => deleteRows({ ...data, requestId: newRequestId() }),
|
||||||
onMutate: async (variables) => {
|
onMutate: async (variables) => {
|
||||||
await queryClient.cancelQueries({
|
await queryClient.cancelQueries({
|
||||||
queryKey: ["base-rows", variables.baseId],
|
queryKey: ["base-rows", variables.pageId],
|
||||||
});
|
});
|
||||||
|
|
||||||
const snapshots = queryClient.getQueriesData<
|
const snapshots = queryClient.getQueriesData<
|
||||||
InfiniteData<IPagination<IBaseRow>>
|
InfiniteData<IPagination<IBaseRow>>
|
||||||
>({ queryKey: ["base-rows", variables.baseId] });
|
>({ queryKey: ["base-rows", variables.pageId] });
|
||||||
|
|
||||||
const removeSet = new Set(variables.rowIds);
|
const removeSet = new Set(variables.rowIds);
|
||||||
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
||||||
{ queryKey: ["base-rows", variables.baseId] },
|
{ queryKey: ["base-rows", variables.pageId] },
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -287,7 +287,7 @@ export function useDeleteRowsMutation() {
|
|||||||
* of the key so a "show exact" toggle doesn't clobber the estimate cache.
|
* of the key so a "show exact" toggle doesn't clobber the estimate cache.
|
||||||
*/
|
*/
|
||||||
export function useBaseRowsCountQuery(
|
export function useBaseRowsCountQuery(
|
||||||
baseId: string | undefined,
|
pageId: string | undefined,
|
||||||
filter?: FilterNode,
|
filter?: FilterNode,
|
||||||
search?: SearchSpec,
|
search?: SearchSpec,
|
||||||
exact = false,
|
exact = false,
|
||||||
@@ -296,15 +296,15 @@ export function useBaseRowsCountQuery(
|
|||||||
const activeSearch = search?.query ? search : undefined;
|
const activeSearch = search?.query ? search : undefined;
|
||||||
|
|
||||||
return useQuery<CountRowsResult>({
|
return useQuery<CountRowsResult>({
|
||||||
queryKey: ["base-rows-count", baseId, activeFilter, activeSearch, exact],
|
queryKey: ["base-rows-count", pageId, activeFilter, activeSearch, exact],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
countRows({
|
countRows({
|
||||||
baseId: baseId!,
|
pageId: pageId!,
|
||||||
filter: activeFilter,
|
filter: activeFilter,
|
||||||
search: activeSearch,
|
search: activeSearch,
|
||||||
exact,
|
exact,
|
||||||
}),
|
}),
|
||||||
enabled: !!baseId,
|
enabled: !!pageId,
|
||||||
staleTime: 30 * 1000,
|
staleTime: 30 * 1000,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -315,15 +315,15 @@ export function useReorderRowMutation() {
|
|||||||
mutationFn: (data) => reorderRow({ ...data, requestId: newRequestId() }),
|
mutationFn: (data) => reorderRow({ ...data, requestId: newRequestId() }),
|
||||||
onMutate: async (variables) => {
|
onMutate: async (variables) => {
|
||||||
await queryClient.cancelQueries({
|
await queryClient.cancelQueries({
|
||||||
queryKey: ["base-rows", variables.baseId],
|
queryKey: ["base-rows", variables.pageId],
|
||||||
});
|
});
|
||||||
|
|
||||||
const snapshots = queryClient.getQueriesData<
|
const snapshots = queryClient.getQueriesData<
|
||||||
InfiniteData<IPagination<IBaseRow>>
|
InfiniteData<IPagination<IBaseRow>>
|
||||||
>({ queryKey: ["base-rows", variables.baseId] });
|
>({ queryKey: ["base-rows", variables.pageId] });
|
||||||
|
|
||||||
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
queryClient.setQueriesData<InfiniteData<IPagination<IBaseRow>>>(
|
||||||
{ queryKey: ["base-rows", variables.baseId] },
|
{ queryKey: ["base-rows", variables.pageId] },
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function useCreateViewMutation() {
|
|||||||
mutationFn: (data) => createView(data),
|
mutationFn: (data) => createView(data),
|
||||||
onSuccess: (newView) => {
|
onSuccess: (newView) => {
|
||||||
queryClient.setQueryData<IBase>(
|
queryClient.setQueryData<IBase>(
|
||||||
["bases", newView.baseId],
|
["bases", newView.pageId],
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -46,16 +46,16 @@ export function useUpdateViewMutation() {
|
|||||||
mutationFn: (data) => updateView(data),
|
mutationFn: (data) => updateView(data),
|
||||||
onMutate: async (variables) => {
|
onMutate: async (variables) => {
|
||||||
await queryClient.cancelQueries({
|
await queryClient.cancelQueries({
|
||||||
queryKey: ["bases", variables.baseId],
|
queryKey: ["bases", variables.pageId],
|
||||||
});
|
});
|
||||||
|
|
||||||
const previous = queryClient.getQueryData<IBase>([
|
const previous = queryClient.getQueryData<IBase>([
|
||||||
"bases",
|
"bases",
|
||||||
variables.baseId,
|
variables.pageId,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
queryClient.setQueryData<IBase>(
|
queryClient.setQueryData<IBase>(
|
||||||
["bases", variables.baseId],
|
["bases", variables.pageId],
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -85,7 +85,7 @@ export function useUpdateViewMutation() {
|
|||||||
onError: (_, variables, context) => {
|
onError: (_, variables, context) => {
|
||||||
if (context?.previous) {
|
if (context?.previous) {
|
||||||
queryClient.setQueryData(
|
queryClient.setQueryData(
|
||||||
["bases", variables.baseId],
|
["bases", variables.pageId],
|
||||||
context.previous,
|
context.previous,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ export function useUpdateViewMutation() {
|
|||||||
},
|
},
|
||||||
onSuccess: (updatedView) => {
|
onSuccess: (updatedView) => {
|
||||||
queryClient.setQueryData<IBase>(
|
queryClient.setQueryData<IBase>(
|
||||||
["bases", updatedView.baseId],
|
["bases", updatedView.pageId],
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
@@ -117,7 +117,7 @@ export function useDeleteViewMutation() {
|
|||||||
mutationFn: (data) => deleteView(data),
|
mutationFn: (data) => deleteView(data),
|
||||||
onSuccess: (_, variables) => {
|
onSuccess: (_, variables) => {
|
||||||
queryClient.setQueryData<IBase>(
|
queryClient.setQueryData<IBase>(
|
||||||
["bases", variables.baseId],
|
["bases", variables.pageId],
|
||||||
(old) => {
|
(old) => {
|
||||||
if (!old) return old;
|
if (!old) return old;
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ export async function createBase(data: CreateBaseInput): Promise<IBase> {
|
|||||||
return req.data;
|
return req.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getBaseInfo(baseId: string): Promise<IBase> {
|
export async function getBaseInfo(pageId: string): Promise<IBase> {
|
||||||
const req = await api.post<IBase>("/bases/info", { baseId });
|
const req = await api.post<IBase>("/bases/info", { pageId });
|
||||||
return req.data;
|
return req.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,14 +45,14 @@ export async function updateBase(data: UpdateBaseInput): Promise<IBase> {
|
|||||||
return req.data;
|
return req.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteBase(baseId: string): Promise<void> {
|
export async function deleteBase(pageId: string): Promise<void> {
|
||||||
await api.post("/bases/delete", { baseId });
|
await api.post("/bases/delete", { pageId });
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function exportBaseToCsv(baseId: string): Promise<void> {
|
export async function exportBaseToCsv(pageId: string): Promise<void> {
|
||||||
const req = await api.post(
|
const req = await api.post(
|
||||||
"/bases/export-csv",
|
"/bases/export-csv",
|
||||||
{ baseId },
|
{ pageId },
|
||||||
{ responseType: "blob" },
|
{ responseType: "blob" },
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -115,9 +115,9 @@ export async function createRow(data: CreateRowInput): Promise<IBaseRow> {
|
|||||||
|
|
||||||
export async function getRowInfo(
|
export async function getRowInfo(
|
||||||
rowId: string,
|
rowId: string,
|
||||||
baseId: string,
|
pageId: string,
|
||||||
): Promise<IBaseRow> {
|
): Promise<IBaseRow> {
|
||||||
const req = await api.post<IBaseRow>("/bases/rows/info", { rowId, baseId });
|
const req = await api.post<IBaseRow>("/bases/rows/info", { rowId, pageId });
|
||||||
return req.data;
|
return req.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ export async function deleteRows(data: DeleteRowsInput): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function listRows(
|
export async function listRows(
|
||||||
baseId: string,
|
pageId: string,
|
||||||
params?: {
|
params?: {
|
||||||
viewId?: string;
|
viewId?: string;
|
||||||
cursor?: string;
|
cursor?: string;
|
||||||
@@ -145,7 +145,7 @@ export async function listRows(
|
|||||||
search?: SearchSpec;
|
search?: SearchSpec;
|
||||||
},
|
},
|
||||||
): Promise<IPagination<IBaseRow>> {
|
): Promise<IPagination<IBaseRow>> {
|
||||||
const req = await api.post("/bases/rows", { baseId, ...params });
|
const req = await api.post("/bases/rows", { pageId, ...params });
|
||||||
return req.data;
|
return req.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ export async function deleteView(data: DeleteViewInput): Promise<void> {
|
|||||||
await api.post("/bases/views/delete", data);
|
await api.post("/bases/views/delete", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function listViews(baseId: string): Promise<IBaseView[]> {
|
export async function listViews(pageId: string): Promise<IBaseView[]> {
|
||||||
const req = await api.post<IBaseView[]>("/bases/views", { baseId });
|
const req = await api.post<IBaseView[]>("/bases/views", { pageId });
|
||||||
return req.data;
|
return req.data;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user