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:
1 parent
947f3a1899
commit
6325f8f109
19 files changed
+2170
-53
No files matched your search
@@ -0,0 +1,46 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// Generated by Microsoft Kiota
|
||||
// @ts-ignore
|
||||
import { createSpaceStatisticsDtoFromDiscriminatorValue, type SpaceStatisticsDto } 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/space/{spaceId}/statistics
|
||||
*/
|
||||
export interface StatisticsRequestBuilder extends BaseRequestBuilder<StatisticsRequestBuilder> {
|
||||
/**
|
||||
* 스페이스의 통계 정보(전체 페이지 수, 루트 페이지 수 등)를 조회합니다.
|
||||
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
|
||||
* @returns {Promise<SpaceStatisticsDto>}
|
||||
* @throws {SpaceStatisticsDto} error when the service returns a 4XX or 5XX status code
|
||||
*/
|
||||
get(requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<SpaceStatisticsDto | undefined>;
|
||||
/**
|
||||
* 스페이스의 통계 정보(전체 페이지 수, 루트 페이지 수 등)를 조회합니다.
|
||||
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
|
||||
* @returns {RequestInformation}
|
||||
*/
|
||||
toGetRequestInformation(requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation;
|
||||
}
|
||||
/**
|
||||
* Uri template for the request builder.
|
||||
*/
|
||||
export const StatisticsRequestBuilderUriTemplate = "{+baseurl}/v1/space/{spaceId}/statistics";
|
||||
/**
|
||||
* Metadata for all the requests in the request builder.
|
||||
*/
|
||||
export const StatisticsRequestBuilderRequestsMetadata: RequestsMetadata = {
|
||||
get: {
|
||||
uriTemplate: StatisticsRequestBuilderUriTemplate,
|
||||
responseBodyContentType: "application/json",
|
||||
errorMappings: {
|
||||
XXX: createSpaceStatisticsDtoFromDiscriminatorValue as ParsableFactory<Parsable>,
|
||||
},
|
||||
adapterMethodName: "send",
|
||||
responseBodyFactory: createSpaceStatisticsDtoFromDiscriminatorValue,
|
||||
},
|
||||
};
|
||||
/* tslint:enable */
|
||||
/* eslint-enable */
|
||||
Reference in new issue
Block a user