Integrates page entity with backend API

Refactors all page entity operations (get, create, update, delete) to use the Kiota-generated API client instead of mock data. This involves:

*   Replacing in-memory data and simulated delays with actual API calls to the `/v1/page` endpoint.
*   Introducing `ApiClient` and `Guid` types from Kiota for API interactions.
*   Adding a mapping function (`mapPageResponseToPage`) to convert API DTOs to the application's local `Page` type.
*   Updating page-related UI components (`PageListPage`, `PageDetailPage`, `PageEditPage`) to pass the authenticated `ApiClient` and `userId` to the entity functions.
*   Regenerating the Kiota client to include new `image`, `page`, and `space` API endpoints and their associated DTOs.
*   Introducing `useApiClient` and `useUserId` hooks for streamlined API client access and user context.
This commit is contained in:
dahyeon committed 2025-11-11 01:04:35 +09:00
1 parent 947f3a1899
commit 6325f8f109
19 files changed
+2170 -53

No files matched your search

+78
View File
@@ -0,0 +1,78 @@
/* tslint:disable */
/* eslint-disable */
// Generated by Microsoft Kiota
// @ts-ignore
import { createDeleteResponseDtoFromDiscriminatorValue, createPageResponseDtoFromDiscriminatorValue, serializeDeletePageDto, serializeDeleteResponseDto, serializePageResponseDto, serializeUpdatePageDto, type DeletePageDto, type DeleteResponseDto, type PageResponseDto, type UpdatePageDto } from '../../../models/index.js';
// @ts-ignore
import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
/**
* Builds and executes requests for operations under /v1/page/{pageId}
*/
export interface WithPageItemRequestBuilder extends BaseRequestBuilder<WithPageItemRequestBuilder> {
/**
* 페이지를 소프트 삭제합니다 (isDeleted 플래그를 true로 설정).
* @param body The request body
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns {Promise<DeleteResponseDto>}
* @throws {DeleteResponseDto} error when the service returns a 4XX or 5XX status code
*/
delete(body: DeletePageDto, requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<DeleteResponseDto | undefined>;
/**
* 페이지의 제목, 내용, 부모 페이지, 정렬 순서 등을 업데이트합니다.
* @param body The request body
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns {Promise<PageResponseDto>}
* @throws {PageResponseDto} error when the service returns a 4XX or 5XX status code
*/
put(body: UpdatePageDto, requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<PageResponseDto | undefined>;
/**
* 페이지를 소프트 삭제합니다 (isDeleted 플래그를 true로 설정).
* @param body The request body
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns {RequestInformation}
*/
toDeleteRequestInformation(body: DeletePageDto, requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation;
/**
* 페이지의 제목, 내용, 부모 페이지, 정렬 순서 등을 업데이트합니다.
* @param body The request body
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @returns {RequestInformation}
*/
toPutRequestInformation(body: UpdatePageDto, requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation;
}
/**
* Uri template for the request builder.
*/
export const WithPageItemRequestBuilderUriTemplate = "{+baseurl}/v1/page/{pageId}";
/**
* Metadata for all the requests in the request builder.
*/
export const WithPageItemRequestBuilderRequestsMetadata: RequestsMetadata = {
delete: {
uriTemplate: WithPageItemRequestBuilderUriTemplate,
responseBodyContentType: "application/json",
errorMappings: {
XXX: createDeleteResponseDtoFromDiscriminatorValue as ParsableFactory<Parsable>,
},
adapterMethodName: "send",
responseBodyFactory: createDeleteResponseDtoFromDiscriminatorValue,
requestBodyContentType: "application/json",
requestBodySerializer: serializeDeletePageDto,
requestInformationContentSetMethod: "setContentFromParsable",
},
put: {
uriTemplate: WithPageItemRequestBuilderUriTemplate,
responseBodyContentType: "application/json",
errorMappings: {
XXX: createPageResponseDtoFromDiscriminatorValue as ParsableFactory<Parsable>,
},
adapterMethodName: "send",
responseBodyFactory: createPageResponseDtoFromDiscriminatorValue,
requestBodyContentType: "application/json",
requestBodySerializer: serializeUpdatePageDto,
requestInformationContentSetMethod: "setContentFromParsable",
},
};
/* tslint:enable */
/* eslint-enable */