Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VCCI-News
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Văn Hoàng
VCCI-News
Commits
edbc9f87
Commit
edbc9f87
authored
May 16, 2026
by
Lê Bảo Hồng Đức
☄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix api
parent
b6c2eab7
Changes
187
Hide whitespace changes
Inline
Side-by-side
Showing
187 changed files
with
1676 additions
and
942 deletions
+1676
-942
orval.config.ts
orval.config.ts
+4
-0
query-client.ts
src/api/config/query-client.ts
+13
-7
category.ts
src/api/endpoints/category.ts
+196
-196
contact.ts
src/api/endpoints/contact.ts
+196
-196
page-config.ts
src/api/endpoints/page-config.ts
+194
-194
apiResponse.ts
src/api/models/apiResponse.ts
+1
-1
apiResponseResponseData.ts
src/api/models/apiResponseResponseData.ts
+1
-1
apiResponseViolationItem.ts
src/api/models/apiResponseViolationItem.ts
+1
-1
badRequestResponse.ts
src/api/models/badRequestResponse.ts
+1
-1
badRequestResponseError.ts
src/api/models/badRequestResponseError.ts
+1
-1
badRequestResponseErrorMessage.ts
src/api/models/badRequestResponseErrorMessage.ts
+1
-1
badRequestResponseResponseData.ts
src/api/models/badRequestResponseResponseData.ts
+1
-1
badRequestResponseViolationItem.ts
src/api/models/badRequestResponseViolationItem.ts
+1
-1
business.ts
src/api/models/business.ts
+1
-1
businessCreate.ts
src/api/models/businessCreate.ts
+1
-1
businessDeleteResponse.ts
src/api/models/businessDeleteResponse.ts
+1
-1
businessDeleteResponseResponseData.ts
src/api/models/businessDeleteResponseResponseData.ts
+1
-1
businessDeleteResponseViolations.ts
src/api/models/businessDeleteResponseViolations.ts
+1
-1
businessGetAllResponse.ts
src/api/models/businessGetAllResponse.ts
+1
-1
businessGetAllResponseResponseData.ts
src/api/models/businessGetAllResponseResponseData.ts
+1
-1
businessGetAllResponseViolations.ts
src/api/models/businessGetAllResponseViolations.ts
+1
-1
businessGetOneResponse.ts
src/api/models/businessGetOneResponse.ts
+1
-1
businessGetOneResponseViolations.ts
src/api/models/businessGetOneResponseViolations.ts
+1
-1
businessLogoSummary.ts
src/api/models/businessLogoSummary.ts
+1
-1
businessMutate.ts
src/api/models/businessMutate.ts
+1
-1
businessUpdate.ts
src/api/models/businessUpdate.ts
+1
-1
category.ts
src/api/models/category.ts
+1
-1
categoryMutate.ts
src/api/models/categoryMutate.ts
+1
-1
categoryTag.ts
src/api/models/categoryTag.ts
+1
-1
categoryTagMutate.ts
src/api/models/categoryTagMutate.ts
+1
-1
categoryThumbnail.ts
src/api/models/categoryThumbnail.ts
+1
-1
contact.ts
src/api/models/contact.ts
+1
-1
contactMutate.ts
src/api/models/contactMutate.ts
+1
-1
file.ts
src/api/models/file.ts
+1
-1
fileCompressInfo.ts
src/api/models/fileCompressInfo.ts
+1
-1
fileImportInfo.ts
src/api/models/fileImportInfo.ts
+1
-1
fileMutate.ts
src/api/models/fileMutate.ts
+1
-1
fileMutateCompressInfo.ts
src/api/models/fileMutateCompressInfo.ts
+1
-1
fileMutateImportInfo.ts
src/api/models/fileMutateImportInfo.ts
+1
-1
filtersMutateParameter.ts
src/api/models/filtersMutateParameter.ts
+1
-1
filtersParameter.ts
src/api/models/filtersParameter.ts
+1
-1
forgotPasswordResetRequest.ts
src/api/models/forgotPasswordResetRequest.ts
+1
-1
forgotPasswordSendOtpRequest.ts
src/api/models/forgotPasswordSendOtpRequest.ts
+1
-1
forgotPasswordVerifyOtpRequest.ts
src/api/models/forgotPasswordVerifyOtpRequest.ts
+1
-1
forgotPasswordVerifyOtpResponse.ts
src/api/models/forgotPasswordVerifyOtpResponse.ts
+1
-1
index.ts
src/api/models/index.ts
+1
-1
loginRequest.ts
src/api/models/loginRequest.ts
+1
-1
loginRequestDeviceInfo.ts
src/api/models/loginRequestDeviceInfo.ts
+1
-1
loginResponse.ts
src/api/models/loginResponse.ts
+1
-1
logo.ts
src/api/models/logo.ts
+1
-1
logoCreate.ts
src/api/models/logoCreate.ts
+1
-1
logoFile.ts
src/api/models/logoFile.ts
+1
-1
logoMutate.ts
src/api/models/logoMutate.ts
+1
-1
logoUpdate.ts
src/api/models/logoUpdate.ts
+1
-1
mediaAsset.ts
src/api/models/mediaAsset.ts
+1
-1
mediaAssetMutate.ts
src/api/models/mediaAssetMutate.ts
+1
-1
mediaAssetMutateVariants.ts
src/api/models/mediaAssetMutateVariants.ts
+1
-1
mediaAssetVariants.ts
src/api/models/mediaAssetVariants.ts
+1
-1
memberCreate.ts
src/api/models/memberCreate.ts
+1
-1
memberImportResponse.ts
src/api/models/memberImportResponse.ts
+1
-1
memberImportWarningItem.ts
src/api/models/memberImportWarningItem.ts
+1
-1
memberUpdate.ts
src/api/models/memberUpdate.ts
+1
-1
migrationCheckpoint.ts
src/api/models/migrationCheckpoint.ts
+1
-1
migrationCheckpointErrorSummary.ts
src/api/models/migrationCheckpointErrorSummary.ts
+1
-1
migrationCheckpointMutate.ts
src/api/models/migrationCheckpointMutate.ts
+1
-1
migrationCheckpointMutateErrorSummary.ts
src/api/models/migrationCheckpointMutateErrorSummary.ts
+1
-1
migrationMapping.ts
src/api/models/migrationMapping.ts
+1
-1
migrationMappingMetadata.ts
src/api/models/migrationMappingMetadata.ts
+1
-1
migrationMappingMutate.ts
src/api/models/migrationMappingMutate.ts
+1
-1
migrationMappingMutateMetadata.ts
src/api/models/migrationMappingMutateMetadata.ts
+1
-1
pageConfig.ts
src/api/models/pageConfig.ts
+1
-1
pageConfigCategory.ts
src/api/models/pageConfigCategory.ts
+1
-1
pageConfigCategoryMutate.ts
src/api/models/pageConfigCategoryMutate.ts
+1
-1
pageConfigMutate.ts
src/api/models/pageConfigMutate.ts
+1
-1
pageConfigTag.ts
src/api/models/pageConfigTag.ts
+1
-1
pageConfigTagMutate.ts
src/api/models/pageConfigTagMutate.ts
+1
-1
pageParameter.ts
src/api/models/pageParameter.ts
+1
-1
pageSizeParameter.ts
src/api/models/pageSizeParameter.ts
+1
-1
permission.ts
src/api/models/permission.ts
+1
-1
permissionBulkCreate.ts
src/api/models/permissionBulkCreate.ts
+1
-1
permissionBulkDelete.ts
src/api/models/permissionBulkDelete.ts
+1
-1
permissionCreate.ts
src/api/models/permissionCreate.ts
+1
-1
permissionMutate.ts
src/api/models/permissionMutate.ts
+1
-1
permissionUpdate.ts
src/api/models/permissionUpdate.ts
+1
-1
position.ts
src/api/models/position.ts
+1
-1
positionMutate.ts
src/api/models/positionMutate.ts
+1
-1
post.ts
src/api/models/post.ts
+1
-1
postCategory.ts
src/api/models/postCategory.ts
+1
-1
postCategoryBulkCreate.ts
src/api/models/postCategoryBulkCreate.ts
+1
-1
postCategoryMutate.ts
src/api/models/postCategoryMutate.ts
+1
-1
postContentStructure.ts
src/api/models/postContentStructure.ts
+1
-1
postMutate.ts
src/api/models/postMutate.ts
+1
-1
postMutateContentStructure.ts
src/api/models/postMutateContentStructure.ts
+1
-1
postTag.ts
src/api/models/postTag.ts
+1
-1
postTagBulkCreate.ts
src/api/models/postTagBulkCreate.ts
+1
-1
postTagMutate.ts
src/api/models/postTagMutate.ts
+1
-1
response.ts
src/api/models/response.ts
+1
-1
responseGetAllData.ts
src/api/models/responseGetAllData.ts
+1
-1
responseGetAllDataAllOf.ts
src/api/models/responseGetAllDataAllOf.ts
+1
-1
responseGetAllDataAllOfResponseData.ts
src/api/models/responseGetAllDataAllOfResponseData.ts
+1
-1
responseGetAllDataAllOfResponseDataRowsItem.ts
...api/models/responseGetAllDataAllOfResponseDataRowsItem.ts
+1
-1
responseResponseData.ts
src/api/models/responseResponseData.ts
+1
-1
responseViolationItem.ts
src/api/models/responseViolationItem.ts
+1
-1
role.ts
src/api/models/role.ts
+1
-1
roleBulkCreate.ts
src/api/models/roleBulkCreate.ts
+1
-1
roleBulkDelete.ts
src/api/models/roleBulkDelete.ts
+1
-1
roleCreate.ts
src/api/models/roleCreate.ts
+1
-1
roleMutate.ts
src/api/models/roleMutate.ts
+1
-1
roleMutatePermissions.ts
src/api/models/roleMutatePermissions.ts
+1
-1
rolePermission.ts
src/api/models/rolePermission.ts
+1
-1
rolePermissionBulkCreateByRole.ts
src/api/models/rolePermissionBulkCreateByRole.ts
+1
-1
rolePermissionBulkDelete.ts
src/api/models/rolePermissionBulkDelete.ts
+1
-1
rolePermissionMutate.ts
src/api/models/rolePermissionMutate.ts
+1
-1
roleUpdate.ts
src/api/models/roleUpdate.ts
+1
-1
schemaMigration.ts
src/api/models/schemaMigration.ts
+1
-1
schemaMigrationMutate.ts
src/api/models/schemaMigrationMutate.ts
+1
-1
siteInformation.ts
src/api/models/siteInformation.ts
+1
-1
siteInformationData.ts
src/api/models/siteInformationData.ts
+1
-1
siteInformationLinkSocials.ts
src/api/models/siteInformationLinkSocials.ts
+1
-1
siteInformationMutate.ts
src/api/models/siteInformationMutate.ts
+1
-1
siteInformationMutateLinkSocials.ts
src/api/models/siteInformationMutateLinkSocials.ts
+1
-1
siteInformationResponse.ts
src/api/models/siteInformationResponse.ts
+1
-1
siteInformationResponseAllOf.ts
src/api/models/siteInformationResponseAllOf.ts
+1
-1
siteInformationSocialLink.ts
src/api/models/siteInformationSocialLink.ts
+1
-1
siteInformationUpdateBody.ts
src/api/models/siteInformationUpdateBody.ts
+1
-1
sortFieldParameter.ts
src/api/models/sortFieldParameter.ts
+1
-1
sortOrderParameter.ts
src/api/models/sortOrderParameter.ts
+1
-1
tag.ts
src/api/models/tag.ts
+1
-1
tagListByIds.ts
src/api/models/tagListByIds.ts
+1
-1
tagMutate.ts
src/api/models/tagMutate.ts
+1
-1
term.ts
src/api/models/term.ts
+1
-1
termCreateRequest.ts
src/api/models/termCreateRequest.ts
+1
-1
termMember.ts
src/api/models/termMember.ts
+1
-1
termMemberAvatar.ts
src/api/models/termMemberAvatar.ts
+1
-1
termMemberAvatarProperty.ts
src/api/models/termMemberAvatarProperty.ts
+1
-1
termMutate.ts
src/api/models/termMutate.ts
+1
-1
termPosition.ts
src/api/models/termPosition.ts
+1
-1
termPositionMember.ts
src/api/models/termPositionMember.ts
+1
-1
termPositionMemberMutate.ts
src/api/models/termPositionMemberMutate.ts
+1
-1
termPositionMutate.ts
src/api/models/termPositionMutate.ts
+1
-1
termPositionRequestItem.ts
src/api/models/termPositionRequestItem.ts
+1
-1
termPositionResponse.ts
src/api/models/termPositionResponse.ts
+1
-1
termResponse.ts
src/api/models/termResponse.ts
+1
-1
termUpdateRequest.ts
src/api/models/termUpdateRequest.ts
+1
-1
unauthorizedResponse.ts
src/api/models/unauthorizedResponse.ts
+1
-1
unauthorizedResponseError.ts
src/api/models/unauthorizedResponseError.ts
+1
-1
unauthorizedResponseErrorMessage.ts
src/api/models/unauthorizedResponseErrorMessage.ts
+1
-1
unauthorizedResponseResponseData.ts
src/api/models/unauthorizedResponseResponseData.ts
+1
-1
unauthorizedResponseViolationItem.ts
src/api/models/unauthorizedResponseViolationItem.ts
+1
-1
user.ts
src/api/models/user.ts
+1
-1
userAuth.ts
src/api/models/userAuth.ts
+1
-1
userAuthMutate.ts
src/api/models/userAuthMutate.ts
+1
-1
userAuthMutatePasswordHistory.ts
src/api/models/userAuthMutatePasswordHistory.ts
+1
-1
userAuthPasswordHistory.ts
src/api/models/userAuthPasswordHistory.ts
+1
-1
userChangePassword.ts
src/api/models/userChangePassword.ts
+1
-1
userCreate.ts
src/api/models/userCreate.ts
+1
-1
userCreateGender.ts
src/api/models/userCreateGender.ts
+1
-1
userCreateType.ts
src/api/models/userCreateType.ts
+1
-1
userMeResponse.ts
src/api/models/userMeResponse.ts
+1
-1
userMutate.ts
src/api/models/userMutate.ts
+1
-1
userRole.ts
src/api/models/userRole.ts
+1
-1
userRoleAssignedByUser.ts
src/api/models/userRoleAssignedByUser.ts
+1
-1
userRoleCreate.ts
src/api/models/userRoleCreate.ts
+1
-1
userRoleListData.ts
src/api/models/userRoleListData.ts
+1
-1
userRoleMutate.ts
src/api/models/userRoleMutate.ts
+1
-1
userRoleRole.ts
src/api/models/userRoleRole.ts
+1
-1
userRoleRoleSummary.ts
src/api/models/userRoleRoleSummary.ts
+1
-1
userRoleUpdate.ts
src/api/models/userRoleUpdate.ts
+1
-1
userRoleUser.ts
src/api/models/userRoleUser.ts
+1
-1
userRoleUserSummary.ts
src/api/models/userRoleUserSummary.ts
+1
-1
userRoleUserSummaryType.ts
src/api/models/userRoleUserSummaryType.ts
+1
-1
userSession.ts
src/api/models/userSession.ts
+1
-1
userSessionDeviceInfo.ts
src/api/models/userSessionDeviceInfo.ts
+1
-1
userSessionMutate.ts
src/api/models/userSessionMutate.ts
+1
-1
userSessionMutateDeviceInfo.ts
src/api/models/userSessionMutateDeviceInfo.ts
+1
-1
userUpdate.ts
src/api/models/userUpdate.ts
+1
-1
userUpdateGender.ts
src/api/models/userUpdateGender.ts
+1
-1
userUpdateType.ts
src/api/models/userUpdateType.ts
+1
-1
custom-client.ts
src/api/mutator/custom-client.ts
+111
-5
orval-client.ts
src/api/mutator/orval-client.ts
+134
-6
page.tsx
.../admin/header-config/[categoryId]/posts/[postId]/page.tsx
+4
-2
page.tsx
src/app/admin/header-config/[categoryId]/posts/page.tsx
+160
-45
page.tsx
src/app/admin/news/[id]/page.tsx
+6
-1
page.tsx
src/app/admin/news/page.tsx
+146
-46
admin-row-actions.tsx
src/components/admin/admin-row-actions.tsx
+27
-1
news-form.tsx
src/components/admin/news-form.tsx
+292
-58
cms-admin.ts
src/lib/api/cms-admin.ts
+20
-12
No files found.
orval.config.ts
View file @
edbc9f87
...
@@ -76,6 +76,10 @@ const orvalConfig = async () => {
...
@@ -76,6 +76,10 @@ const orvalConfig = async () => {
client
:
"react-query"
,
client
:
"react-query"
,
prettier
:
true
,
prettier
:
true
,
override
:
{
override
:
{
mutator
:
{
path
:
"src/api/mutator/custom-client.ts"
,
name
:
"useCustomClient"
,
},
query
:
{
query
:
{
useQuery
:
true
,
useQuery
:
true
,
useInfinite
:
true
,
useInfinite
:
true
,
...
...
src/api/config/query-client.ts
View file @
edbc9f87
...
@@ -10,10 +10,12 @@ import { QueryData } from '@/lib/types/base-api'
...
@@ -10,10 +10,12 @@ import { QueryData } from '@/lib/types/base-api'
// import { BASE_PATHS } from '@/constants/path'
// import { BASE_PATHS } from '@/constants/path'
// Constants
// Constants
const
RETRY_COUNT
=
3
const
RETRY_COUNT
=
3
const
EXPIRED_TOKEN_ERROR
=
401
const
EXPIRED_TOKEN_ERROR
=
401
const
DENIED_PERMISSION_ERROR
=
403
const
DENIED_PERMISSION_ERROR
=
403
const
INTERNAL_SERVER_ERROR
=
500
const
INTERNAL_SERVER_ERROR
=
500
const
API_QUERY_STALE_TIME
=
2
*
60
*
1000
const
API_QUERY_GC_TIME
=
10
*
60
*
1000
// Utils
// Utils
// Handle check base retry logical
// Handle check base retry logical
...
@@ -56,9 +58,13 @@ const handleDelayRetry = (failureCount: number) => failureCount * 1000 + Math.ra
...
@@ -56,9 +58,13 @@ const handleDelayRetry = (failureCount: number) => failureCount * 1000 + Math.ra
// Query client
// Query client
export
const
queryClient
=
new
QueryClient
({
export
const
queryClient
=
new
QueryClient
({
defaultOptions
:
{
defaultOptions
:
{
queries
:
{
queries
:
{
refetchOnWindowFocus
:
false
,
staleTime
:
API_QUERY_STALE_TIME
,
placeholderData
:
(
previousData
:
unknown
)
=>
previousData
,
gcTime
:
API_QUERY_GC_TIME
,
refetchOnWindowFocus
:
false
,
refetchOnMount
:
false
,
refetchOnReconnect
:
false
,
placeholderData
:
(
previousData
:
unknown
)
=>
previousData
,
retry
(
failureCount
,
error
)
{
retry
(
failureCount
,
error
)
{
if
(
!
handleCheckBaseRetryLogical
(
failureCount
,
error
))
return
false
if
(
!
handleCheckBaseRetryLogical
(
failureCount
,
error
))
return
false
...
...
src/api/endpoints/category.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
@@ -31,11 +31,11 @@ import type {
...
@@ -31,11 +31,11 @@ import type {
import
type
{
import
type
{
CategoryMutate
,
CategoryMutate
,
DeleteCategoryId200
,
Delete
ApiV10
CategoryId200
,
GetCategoryId200
,
Get
ApiV10
CategoryId200
,
GetCategoryParams
,
Get
ApiV10
CategoryParams
,
PostCategory200
,
Post
ApiV10
Category200
,
PutCategoryId200
,
Put
ApiV10
CategoryId200
,
ResponseGetAllData
ResponseGetAllData
}
from
'../models'
;
}
from
'../models'
;
...
@@ -48,36 +48,36 @@ import type {
...
@@ -48,36 +48,36 @@ import type {
* Retrieve a single category record by its ID
* Retrieve a single category record by its ID
* @summary Get category by ID
* @summary Get category by ID
*/
*/
export
type
getCategoryIdResponse200
=
{
export
type
get
ApiV10
CategoryIdResponse200
=
{
data
:
GetCategoryId200
data
:
Get
ApiV10
CategoryId200
status
:
200
status
:
200
}
}
export
type
getCategoryIdResponse404
=
{
export
type
get
ApiV10
CategoryIdResponse404
=
{
data
:
void
data
:
void
status
:
404
status
:
404
}
}
export
type
get
CategoryIdResponseSuccess
=
(
get
CategoryIdResponse200
)
&
{
export
type
get
ApiV10CategoryIdResponseSuccess
=
(
getApiV10
CategoryIdResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
get
CategoryIdResponseError
=
(
get
CategoryIdResponse404
)
&
{
export
type
get
ApiV10CategoryIdResponseError
=
(
getApiV10
CategoryIdResponse404
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
get
CategoryIdResponse
=
(
getCategoryIdResponseSuccess
|
get
CategoryIdResponseError
)
export
type
get
ApiV10CategoryIdResponse
=
(
getApiV10CategoryIdResponseSuccess
|
getApiV10
CategoryIdResponseError
)
export
const
getGetCategoryIdUrl
=
(
id
:
string
,)
=>
{
export
const
getGet
ApiV10
CategoryIdUrl
=
(
id
:
string
,)
=>
{
return
`/category/
${
id
}
`
return
`/
api/v1.0/
category/
${
id
}
`
}
}
export
const
get
CategoryId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
get
CategoryIdResponse
>
=>
{
export
const
get
ApiV10CategoryId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
getApiV10
CategoryIdResponse
>
=>
{
const
res
=
await
fetch
(
getGetCategoryIdUrl
(
id
),
const
res
=
await
fetch
(
getGet
ApiV10
CategoryIdUrl
(
id
),
{
{
...
options
,
...
options
,
method
:
'GET'
method
:
'GET'
...
@@ -88,83 +88,83 @@ export const getCategoryId = async (id: string, options?: RequestInit): Promise<
...
@@ -88,83 +88,83 @@ export const getCategoryId = async (id: string, options?: RequestInit): Promise<
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
getCategoryIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
get
ApiV10
CategoryIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
getCategoryIdResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
get
ApiV10
CategoryIdResponse
}
}
export
const
getGetCategoryIdInfiniteQueryKey
=
(
id
?:
string
,)
=>
{
export
const
getGet
ApiV10
CategoryIdInfiniteQueryKey
=
(
id
?:
string
,)
=>
{
return
[
return
[
'infinite'
,
`/category/
${
id
}
`
'infinite'
,
`/
api/v1.0/
category/
${
id
}
`
]
as
const
;
]
as
const
;
}
}
export
const
getGetCategoryIdQueryKey
=
(
id
?:
string
,)
=>
{
export
const
getGet
ApiV10
CategoryIdQueryKey
=
(
id
?:
string
,)
=>
{
return
[
return
[
`/category/
${
id
}
`
`/
api/v1.0/
category/
${
id
}
`
]
as
const
;
]
as
const
;
}
}
export
const
getGet
CategoryIdInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10CategoryIdInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10CategoryId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetCategoryIdInfiniteQueryKey
(
id
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
CategoryIdInfiniteQueryKey
(
id
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>>
=
({
signal
})
=>
get
CategoryId
(
id
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10CategoryId
>>>
=
({
signal
})
=>
getApiV10
CategoryId
(
id
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
CategoryIdInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>>
export
type
Get
ApiV10CategoryIdInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>>
export
type
GetCategoryIdInfiniteQueryError
=
void
export
type
Get
ApiV10
CategoryIdInfiniteQueryError
=
void
export
function
useGet
CategoryIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10CategoryIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>>
,
TError
=
void
>
(
id
:
string
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
CategoryIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10CategoryIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
CategoryIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10CategoryIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get category by ID
* @summary Get category by ID
*/
*/
export
function
useGet
CategoryIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10CategoryIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetCategoryIdInfiniteQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
CategoryIdInfiniteQueryOptions
(
id
,
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -176,12 +176,12 @@ export function useGetCategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType
...
@@ -176,12 +176,12 @@ export function useGetCategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType
/**
/**
* @summary Get category by ID
* @summary Get category by ID
*/
*/
export
const
prefetchGet
CategoryIdInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>
,
TError
=
void
>
(
export
const
prefetchGet
ApiV10CategoryIdInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>
,
TError
=
void
>
(
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetCategoryIdInfiniteQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
CategoryIdInfiniteQueryOptions
(
id
,
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
...
@@ -190,62 +190,62 @@ export const prefetchGetCategoryIdInfiniteQuery = async <TData = Awaited<ReturnT
...
@@ -190,62 +190,62 @@ export const prefetchGetCategoryIdInfiniteQuery = async <TData = Awaited<ReturnT
export
const
getGet
CategoryIdQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10CategoryIdQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10CategoryId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetCategoryIdQueryKey
(
id
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
CategoryIdQueryKey
(
id
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>>
=
({
signal
})
=>
get
CategoryId
(
id
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10CategoryId
>>>
=
({
signal
})
=>
getApiV10
CategoryId
(
id
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
CategoryIdQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>>
export
type
Get
ApiV10CategoryIdQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>>
export
type
GetCategoryIdQueryError
=
void
export
type
Get
ApiV10
CategoryIdQueryError
=
void
export
function
useGet
CategoryId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10CategoryId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>
,
TError
=
void
>
(
id
:
string
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
CategoryId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10CategoryId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
CategoryId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10CategoryId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get category by ID
* @summary Get category by ID
*/
*/
export
function
useGet
CategoryId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10CategoryId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetCategoryIdQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
CategoryIdQueryOptions
(
id
,
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -257,12 +257,12 @@ export function useGetCategoryId<TData = Awaited<ReturnType<typeof getCategoryId
...
@@ -257,12 +257,12 @@ export function useGetCategoryId<TData = Awaited<ReturnType<typeof getCategoryId
/**
/**
* @summary Get category by ID
* @summary Get category by ID
*/
*/
export
const
prefetchGet
CategoryIdQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
CategoryId
>>
,
TError
=
void
>
(
export
const
prefetchGet
ApiV10CategoryIdQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
CategoryId
>>
,
TError
=
void
>
(
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
CategoryId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetCategoryIdQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
CategoryIdQueryOptions
(
id
,
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
await
queryClient
.
prefetchQuery
(
queryOptions
);
...
@@ -275,37 +275,37 @@ export const prefetchGetCategoryIdQuery = async <TData = Awaited<ReturnType<type
...
@@ -275,37 +275,37 @@ export const prefetchGetCategoryIdQuery = async <TData = Awaited<ReturnType<type
* Update a single category record by its ID
* Update a single category record by its ID
* @summary Update category by ID
* @summary Update category by ID
*/
*/
export
type
putCategoryIdResponse200
=
{
export
type
put
ApiV10
CategoryIdResponse200
=
{
data
:
PutCategoryId200
data
:
Put
ApiV10
CategoryId200
status
:
200
status
:
200
}
}
export
type
putCategoryIdResponse404
=
{
export
type
put
ApiV10
CategoryIdResponse404
=
{
data
:
void
data
:
void
status
:
404
status
:
404
}
}
export
type
put
CategoryIdResponseSuccess
=
(
put
CategoryIdResponse200
)
&
{
export
type
put
ApiV10CategoryIdResponseSuccess
=
(
putApiV10
CategoryIdResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
put
CategoryIdResponseError
=
(
put
CategoryIdResponse404
)
&
{
export
type
put
ApiV10CategoryIdResponseError
=
(
putApiV10
CategoryIdResponse404
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
put
CategoryIdResponse
=
(
putCategoryIdResponseSuccess
|
put
CategoryIdResponseError
)
export
type
put
ApiV10CategoryIdResponse
=
(
putApiV10CategoryIdResponseSuccess
|
putApiV10
CategoryIdResponseError
)
export
const
getPutCategoryIdUrl
=
(
id
:
string
,)
=>
{
export
const
getPut
ApiV10
CategoryIdUrl
=
(
id
:
string
,)
=>
{
return
`/category/
${
id
}
`
return
`/
api/v1.0/
category/
${
id
}
`
}
}
export
const
putCategoryId
=
async
(
id
:
string
,
export
const
put
ApiV10
CategoryId
=
async
(
id
:
string
,
categoryMutate
:
CategoryMutate
,
options
?:
RequestInit
):
Promise
<
putCategoryIdResponse
>
=>
{
categoryMutate
:
CategoryMutate
,
options
?:
RequestInit
):
Promise
<
put
ApiV10
CategoryIdResponse
>
=>
{
const
res
=
await
fetch
(
getPutCategoryIdUrl
(
id
),
const
res
=
await
fetch
(
getPut
ApiV10
CategoryIdUrl
(
id
),
{
{
...
options
,
...
options
,
method
:
'PUT'
,
method
:
'PUT'
,
...
@@ -317,18 +317,18 @@ export const putCategoryId = async (id: string,
...
@@ -317,18 +317,18 @@ export const putCategoryId = async (id: string,
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
putCategoryIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
put
ApiV10
CategoryIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
putCategoryIdResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
put
ApiV10
CategoryIdResponse
}
}
export
const
getPutCategoryIdMutationOptions
=
<
TError
=
void
,
export
const
getPut
ApiV10
CategoryIdMutationOptions
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putCategoryId
>>
,
TError
,{
id
:
string
;
data
:
CategoryMutate
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
ApiV10
CategoryId
>>
,
TError
,{
id
:
string
;
data
:
CategoryMutate
},
TContext
>
,
fetch
?:
RequestInit
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putCategoryId
>>
,
TError
,{
id
:
string
;
data
:
CategoryMutate
},
TContext
>
=>
{
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
ApiV10
CategoryId
>>
,
TError
,{
id
:
string
;
data
:
CategoryMutate
},
TContext
>
=>
{
const
mutationKey
=
[
'putCategoryId'
];
const
mutationKey
=
[
'put
ApiV10
CategoryId'
];
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
options
...
@@ -338,10 +338,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -338,10 +338,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
putCategoryId
>>
,
{
id
:
string
;
data
:
CategoryMutate
}
>
=
(
props
)
=>
{
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
put
ApiV10
CategoryId
>>
,
{
id
:
string
;
data
:
CategoryMutate
}
>
=
(
props
)
=>
{
const
{
id
,
data
}
=
props
??
{};
const
{
id
,
data
}
=
props
??
{};
return
putCategoryId
(
id
,
data
,
fetchOptions
)
return
put
ApiV10
CategoryId
(
id
,
data
,
fetchOptions
)
}
}
...
@@ -349,23 +349,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -349,23 +349,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
return
{
mutationFn
,
...
mutationOptions
}}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
Put
CategoryIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
put
CategoryId
>>>
export
type
Put
ApiV10CategoryIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
putApiV10
CategoryId
>>>
export
type
PutCategoryIdMutationBody
=
CategoryMutate
export
type
Put
ApiV10
CategoryIdMutationBody
=
CategoryMutate
export
type
PutCategoryIdMutationError
=
void
export
type
Put
ApiV10
CategoryIdMutationError
=
void
/**
/**
* @summary Update category by ID
* @summary Update category by ID
*/
*/
export
const
usePutCategoryId
=
<
TError
=
void
,
export
const
usePut
ApiV10
CategoryId
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putCategoryId
>>
,
TError
,{
id
:
string
;
data
:
CategoryMutate
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
ApiV10
CategoryId
>>
,
TError
,{
id
:
string
;
data
:
CategoryMutate
},
TContext
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
putCategoryId
>>
,
Awaited
<
ReturnType
<
typeof
put
ApiV10
CategoryId
>>
,
TError
,
TError
,
{
id
:
string
;
data
:
CategoryMutate
},
{
id
:
string
;
data
:
CategoryMutate
},
TContext
TContext
>
=>
{
>
=>
{
const
mutationOptions
=
getPutCategoryIdMutationOptions
(
options
);
const
mutationOptions
=
getPut
ApiV10
CategoryIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
}
...
@@ -373,36 +373,36 @@ export const usePutCategoryId = <TError = void,
...
@@ -373,36 +373,36 @@ export const usePutCategoryId = <TError = void,
* Delete a single category record by its ID
* Delete a single category record by its ID
* @summary Delete category by ID
* @summary Delete category by ID
*/
*/
export
type
deleteCategoryIdResponse200
=
{
export
type
delete
ApiV10
CategoryIdResponse200
=
{
data
:
DeleteCategoryId200
data
:
Delete
ApiV10
CategoryId200
status
:
200
status
:
200
}
}
export
type
deleteCategoryIdResponse404
=
{
export
type
delete
ApiV10
CategoryIdResponse404
=
{
data
:
void
data
:
void
status
:
404
status
:
404
}
}
export
type
delete
CategoryIdResponseSuccess
=
(
delete
CategoryIdResponse200
)
&
{
export
type
delete
ApiV10CategoryIdResponseSuccess
=
(
deleteApiV10
CategoryIdResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
delete
CategoryIdResponseError
=
(
delete
CategoryIdResponse404
)
&
{
export
type
delete
ApiV10CategoryIdResponseError
=
(
deleteApiV10
CategoryIdResponse404
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
delete
CategoryIdResponse
=
(
deleteCategoryIdResponseSuccess
|
delete
CategoryIdResponseError
)
export
type
delete
ApiV10CategoryIdResponse
=
(
deleteApiV10CategoryIdResponseSuccess
|
deleteApiV10
CategoryIdResponseError
)
export
const
getDeleteCategoryIdUrl
=
(
id
:
string
,)
=>
{
export
const
getDelete
ApiV10
CategoryIdUrl
=
(
id
:
string
,)
=>
{
return
`/category/
${
id
}
`
return
`/
api/v1.0/
category/
${
id
}
`
}
}
export
const
delete
CategoryId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
delete
CategoryIdResponse
>
=>
{
export
const
delete
ApiV10CategoryId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
deleteApiV10
CategoryIdResponse
>
=>
{
const
res
=
await
fetch
(
getDeleteCategoryIdUrl
(
id
),
const
res
=
await
fetch
(
getDelete
ApiV10
CategoryIdUrl
(
id
),
{
{
...
options
,
...
options
,
method
:
'DELETE'
method
:
'DELETE'
...
@@ -413,18 +413,18 @@ export const deleteCategoryId = async (id: string, options?: RequestInit): Promi
...
@@ -413,18 +413,18 @@ export const deleteCategoryId = async (id: string, options?: RequestInit): Promi
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
deleteCategoryIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
delete
ApiV10
CategoryIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
deleteCategoryIdResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
delete
ApiV10
CategoryIdResponse
}
}
export
const
getDeleteCategoryIdMutationOptions
=
<
TError
=
void
,
export
const
getDelete
ApiV10
CategoryIdMutationOptions
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteCategoryId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
CategoryId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteCategoryId
>>
,
TError
,{
id
:
string
},
TContext
>
=>
{
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
CategoryId
>>
,
TError
,{
id
:
string
},
TContext
>
=>
{
const
mutationKey
=
[
'deleteCategoryId'
];
const
mutationKey
=
[
'delete
ApiV10
CategoryId'
];
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
options
...
@@ -434,10 +434,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -434,10 +434,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
deleteCategoryId
>>
,
{
id
:
string
}
>
=
(
props
)
=>
{
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
CategoryId
>>
,
{
id
:
string
}
>
=
(
props
)
=>
{
const
{
id
}
=
props
??
{};
const
{
id
}
=
props
??
{};
return
deleteCategoryId
(
id
,
fetchOptions
)
return
delete
ApiV10
CategoryId
(
id
,
fetchOptions
)
}
}
...
@@ -445,23 +445,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -445,23 +445,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
return
{
mutationFn
,
...
mutationOptions
}}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
Delete
CategoryIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
delete
CategoryId
>>>
export
type
Delete
ApiV10CategoryIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
deleteApiV10
CategoryId
>>>
export
type
DeleteCategoryIdMutationError
=
void
export
type
Delete
ApiV10
CategoryIdMutationError
=
void
/**
/**
* @summary Delete category by ID
* @summary Delete category by ID
*/
*/
export
const
useDeleteCategoryId
=
<
TError
=
void
,
export
const
useDelete
ApiV10
CategoryId
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteCategoryId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
CategoryId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
deleteCategoryId
>>
,
Awaited
<
ReturnType
<
typeof
delete
ApiV10
CategoryId
>>
,
TError
,
TError
,
{
id
:
string
},
{
id
:
string
},
TContext
TContext
>
=>
{
>
=>
{
const
mutationOptions
=
getDeleteCategoryIdMutationOptions
(
options
);
const
mutationOptions
=
getDelete
ApiV10
CategoryIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
}
...
@@ -469,19 +469,19 @@ export const useDeleteCategoryId = <TError = void,
...
@@ -469,19 +469,19 @@ export const useDeleteCategoryId = <TError = void,
* Retrieve a list of category with pagination, filtering and sorting
* Retrieve a list of category with pagination, filtering and sorting
* @summary Get all category
* @summary Get all category
*/
*/
export
type
getCategoryResponse200
=
{
export
type
get
ApiV10
CategoryResponse200
=
{
data
:
ResponseGetAllData
data
:
ResponseGetAllData
status
:
200
status
:
200
}
}
export
type
get
CategoryResponseSuccess
=
(
get
CategoryResponse200
)
&
{
export
type
get
ApiV10CategoryResponseSuccess
=
(
getApiV10
CategoryResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
;
;
export
type
get
CategoryResponse
=
(
get
CategoryResponseSuccess
)
export
type
get
ApiV10CategoryResponse
=
(
getApiV10
CategoryResponseSuccess
)
export
const
getGet
CategoryUrl
=
(
params
?:
Get
CategoryParams
,)
=>
{
export
const
getGet
ApiV10CategoryUrl
=
(
params
?:
GetApiV10
CategoryParams
,)
=>
{
const
normalizedParams
=
new
URLSearchParams
();
const
normalizedParams
=
new
URLSearchParams
();
Object
.
entries
(
params
||
{}).
forEach
(([
key
,
value
])
=>
{
Object
.
entries
(
params
||
{}).
forEach
(([
key
,
value
])
=>
{
...
@@ -493,12 +493,12 @@ export const getGetCategoryUrl = (params?: GetCategoryParams,) => {
...
@@ -493,12 +493,12 @@ export const getGetCategoryUrl = (params?: GetCategoryParams,) => {
const
stringifiedParams
=
normalizedParams
.
toString
();
const
stringifiedParams
=
normalizedParams
.
toString
();
return
stringifiedParams
.
length
>
0
?
`/
category?
${
stringifiedParams
}
`
:
`
/category`
return
stringifiedParams
.
length
>
0
?
`/
api/v1.0/category?
${
stringifiedParams
}
`
:
`/api/v1.0
/category`
}
}
export
const
get
Category
=
async
(
params
?:
GetCategoryParams
,
options
?:
RequestInit
):
Promise
<
get
CategoryResponse
>
=>
{
export
const
get
ApiV10Category
=
async
(
params
?:
GetApiV10CategoryParams
,
options
?:
RequestInit
):
Promise
<
getApiV10
CategoryResponse
>
=>
{
const
res
=
await
fetch
(
getGetCategoryUrl
(
params
),
const
res
=
await
fetch
(
getGet
ApiV10
CategoryUrl
(
params
),
{
{
...
options
,
...
options
,
method
:
'GET'
method
:
'GET'
...
@@ -509,83 +509,83 @@ export const getCategory = async (params?: GetCategoryParams, options?: RequestI
...
@@ -509,83 +509,83 @@ export const getCategory = async (params?: GetCategoryParams, options?: RequestI
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
getCategoryResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
get
ApiV10
CategoryResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
getCategoryResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
get
ApiV10
CategoryResponse
}
}
export
const
getGet
CategoryInfiniteQueryKey
=
(
params
?:
Get
CategoryParams
,)
=>
{
export
const
getGet
ApiV10CategoryInfiniteQueryKey
=
(
params
?:
GetApiV10
CategoryParams
,)
=>
{
return
[
return
[
'infinite'
,
`/category`
,
...(
params
?
[
params
]:
[])
'infinite'
,
`/
api/v1.0/
category`
,
...(
params
?
[
params
]:
[])
]
as
const
;
]
as
const
;
}
}
export
const
getGet
CategoryQueryKey
=
(
params
?:
Get
CategoryParams
,)
=>
{
export
const
getGet
ApiV10CategoryQueryKey
=
(
params
?:
GetApiV10
CategoryParams
,)
=>
{
return
[
return
[
`/category`
,
...(
params
?
[
params
]:
[])
`/
api/v1.0/
category`
,
...(
params
?
[
params
]:
[])
]
as
const
;
]
as
const
;
}
}
export
const
getGet
CategoryInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getCategory
>>>
,
TError
=
unknown
>
(
params
?:
GetCategoryParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10CategoryInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10Category
>>>
,
TError
=
unknown
>
(
params
?:
GetApiV10CategoryParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetCategoryInfiniteQueryKey
(
params
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
CategoryInfiniteQueryKey
(
params
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
Category
>>>
=
({
signal
})
=>
get
Category
(
params
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10Category
>>>
=
({
signal
})
=>
getApiV10
Category
(
params
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategory
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
Category
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
CategoryInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
Category
>>>
export
type
Get
ApiV10CategoryInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>>
export
type
GetCategoryInfiniteQueryError
=
unknown
export
type
Get
ApiV10
CategoryInfiniteQueryError
=
unknown
export
function
useGet
CategoryInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
Category
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10CategoryInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>>
,
TError
=
unknown
>
(
params
:
undefined
|
Get
CategoryParams
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
&
Pick
<
params
:
undefined
|
Get
ApiV10CategoryParams
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getCategory
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
Category
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getCategory
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
Category
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
CategoryInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
Category
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10CategoryInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>>
,
TError
=
unknown
>
(
params
?:
Get
CategoryParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
&
Pick
<
params
?:
Get
ApiV10CategoryParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getCategory
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
Category
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getCategory
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
Category
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
CategoryInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
Category
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10CategoryInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>>
,
TError
=
unknown
>
(
params
?:
Get
CategoryParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10CategoryParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get all category
* @summary Get all category
*/
*/
export
function
useGet
CategoryInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
Category
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10CategoryInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>>
,
TError
=
unknown
>
(
params
?:
Get
CategoryParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10CategoryParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetCategoryInfiniteQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
CategoryInfiniteQueryOptions
(
params
,
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -597,12 +597,12 @@ export function useGetCategoryInfinite<TData = InfiniteData<Awaited<ReturnType<t
...
@@ -597,12 +597,12 @@ export function useGetCategoryInfinite<TData = InfiniteData<Awaited<ReturnType<t
/**
/**
* @summary Get all category
* @summary Get all category
*/
*/
export
const
prefetchGet
CategoryInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
=
unknown
>
(
export
const
prefetchGet
ApiV10CategoryInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
=
unknown
>
(
queryClient
:
QueryClient
,
params
?:
Get
CategoryParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
params
?:
Get
ApiV10CategoryParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetCategoryInfiniteQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
CategoryInfiniteQueryOptions
(
params
,
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
...
@@ -611,62 +611,62 @@ export const prefetchGetCategoryInfiniteQuery = async <TData = Awaited<ReturnTyp
...
@@ -611,62 +611,62 @@ export const prefetchGetCategoryInfiniteQuery = async <TData = Awaited<ReturnTyp
export
const
getGet
CategoryQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getCategory
>>
,
TError
=
unknown
>
(
params
?:
GetCategoryParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10CategoryQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10Category
>>
,
TError
=
unknown
>
(
params
?:
GetApiV10CategoryParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetCategoryQueryKey
(
params
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
CategoryQueryKey
(
params
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
Category
>>>
=
({
signal
})
=>
get
Category
(
params
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10Category
>>>
=
({
signal
})
=>
getApiV10
Category
(
params
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getCategory
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
Category
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
CategoryQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
Category
>>>
export
type
Get
ApiV10CategoryQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>>
export
type
GetCategoryQueryError
=
unknown
export
type
Get
ApiV10
CategoryQueryError
=
unknown
export
function
useGet
Category
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10Category
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
=
unknown
>
(
params
:
undefined
|
Get
CategoryParams
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
&
Pick
<
params
:
undefined
|
Get
ApiV10CategoryParams
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getCategory
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
Category
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getCategory
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
Category
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
Category
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10Category
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
=
unknown
>
(
params
?:
Get
CategoryParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
&
Pick
<
params
?:
Get
ApiV10CategoryParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getCategory
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
Category
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getCategory
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
Category
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
Category
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10Category
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
=
unknown
>
(
params
?:
Get
CategoryParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10CategoryParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get all category
* @summary Get all category
*/
*/
export
function
useGet
Category
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10Category
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
=
unknown
>
(
params
?:
Get
CategoryParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10CategoryParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetCategoryQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
CategoryQueryOptions
(
params
,
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -678,12 +678,12 @@ export function useGetCategory<TData = Awaited<ReturnType<typeof getCategory>>,
...
@@ -678,12 +678,12 @@ export function useGetCategory<TData = Awaited<ReturnType<typeof getCategory>>,
/**
/**
* @summary Get all category
* @summary Get all category
*/
*/
export
const
prefetchGet
CategoryQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
=
unknown
>
(
export
const
prefetchGet
ApiV10CategoryQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
=
unknown
>
(
queryClient
:
QueryClient
,
params
?:
Get
CategoryParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
params
?:
Get
ApiV10CategoryParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Category
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetCategoryQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
CategoryQueryOptions
(
params
,
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
await
queryClient
.
prefetchQuery
(
queryOptions
);
...
@@ -696,29 +696,29 @@ export const prefetchGetCategoryQuery = async <TData = Awaited<ReturnType<typeof
...
@@ -696,29 +696,29 @@ export const prefetchGetCategoryQuery = async <TData = Awaited<ReturnType<typeof
* Create a new category record
* Create a new category record
* @summary Create a category
* @summary Create a category
*/
*/
export
type
postCategoryResponse200
=
{
export
type
post
ApiV10
CategoryResponse200
=
{
data
:
PostCategory200
data
:
Post
ApiV10
Category200
status
:
200
status
:
200
}
}
export
type
post
CategoryResponseSuccess
=
(
post
CategoryResponse200
)
&
{
export
type
post
ApiV10CategoryResponseSuccess
=
(
postApiV10
CategoryResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
;
;
export
type
post
CategoryResponse
=
(
post
CategoryResponseSuccess
)
export
type
post
ApiV10CategoryResponse
=
(
postApiV10
CategoryResponseSuccess
)
export
const
getPostCategoryUrl
=
()
=>
{
export
const
getPost
ApiV10
CategoryUrl
=
()
=>
{
return
`/category`
return
`/
api/v1.0/
category`
}
}
export
const
post
Category
=
async
(
categoryMutate
:
CategoryMutate
,
options
?:
RequestInit
):
Promise
<
post
CategoryResponse
>
=>
{
export
const
post
ApiV10Category
=
async
(
categoryMutate
:
CategoryMutate
,
options
?:
RequestInit
):
Promise
<
postApiV10
CategoryResponse
>
=>
{
const
res
=
await
fetch
(
getPostCategoryUrl
(),
const
res
=
await
fetch
(
getPost
ApiV10
CategoryUrl
(),
{
{
...
options
,
...
options
,
method
:
'POST'
,
method
:
'POST'
,
...
@@ -730,18 +730,18 @@ export const postCategory = async (categoryMutate: CategoryMutate, options?: Req
...
@@ -730,18 +730,18 @@ export const postCategory = async (categoryMutate: CategoryMutate, options?: Req
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
postCategoryResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
post
ApiV10
CategoryResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
postCategoryResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
post
ApiV10
CategoryResponse
}
}
export
const
getPostCategoryMutationOptions
=
<
TError
=
unknown
,
export
const
getPost
ApiV10
CategoryMutationOptions
=
<
TError
=
unknown
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postCategory
>>
,
TError
,{
data
:
CategoryMutate
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
ApiV10
Category
>>
,
TError
,{
data
:
CategoryMutate
},
TContext
>
,
fetch
?:
RequestInit
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postCategory
>>
,
TError
,{
data
:
CategoryMutate
},
TContext
>
=>
{
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
ApiV10
Category
>>
,
TError
,{
data
:
CategoryMutate
},
TContext
>
=>
{
const
mutationKey
=
[
'postCategory'
];
const
mutationKey
=
[
'post
ApiV10
Category'
];
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
options
...
@@ -751,10 +751,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -751,10 +751,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
postCategory
>>
,
{
data
:
CategoryMutate
}
>
=
(
props
)
=>
{
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
post
ApiV10
Category
>>
,
{
data
:
CategoryMutate
}
>
=
(
props
)
=>
{
const
{
data
}
=
props
??
{};
const
{
data
}
=
props
??
{};
return
postCategory
(
data
,
fetchOptions
)
return
post
ApiV10
Category
(
data
,
fetchOptions
)
}
}
...
@@ -762,23 +762,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -762,23 +762,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
return
{
mutationFn
,
...
mutationOptions
}}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
Post
CategoryMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
post
Category
>>>
export
type
Post
ApiV10CategoryMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
postApiV10
Category
>>>
export
type
PostCategoryMutationBody
=
CategoryMutate
export
type
Post
ApiV10
CategoryMutationBody
=
CategoryMutate
export
type
PostCategoryMutationError
=
unknown
export
type
Post
ApiV10
CategoryMutationError
=
unknown
/**
/**
* @summary Create a category
* @summary Create a category
*/
*/
export
const
usePostCategory
=
<
TError
=
unknown
,
export
const
usePost
ApiV10
Category
=
<
TError
=
unknown
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postCategory
>>
,
TError
,{
data
:
CategoryMutate
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
ApiV10
Category
>>
,
TError
,{
data
:
CategoryMutate
},
TContext
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
postCategory
>>
,
Awaited
<
ReturnType
<
typeof
post
ApiV10
Category
>>
,
TError
,
TError
,
{
data
:
CategoryMutate
},
{
data
:
CategoryMutate
},
TContext
TContext
>
=>
{
>
=>
{
const
mutationOptions
=
getPostCategoryMutationOptions
(
options
);
const
mutationOptions
=
getPost
ApiV10
CategoryMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
}
src/api/endpoints/contact.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
@@ -31,11 +31,11 @@ import type {
...
@@ -31,11 +31,11 @@ import type {
import
type
{
import
type
{
ContactMutate
,
ContactMutate
,
DeleteContactId200
,
Delete
ApiV10
ContactId200
,
GetContactId200
,
Get
ApiV10
ContactId200
,
GetContactParams
,
Get
ApiV10
ContactParams
,
PostContact200
,
Post
ApiV10
Contact200
,
PutContactId200
,
Put
ApiV10
ContactId200
,
ResponseGetAllData
ResponseGetAllData
}
from
'../models'
;
}
from
'../models'
;
...
@@ -48,36 +48,36 @@ import type {
...
@@ -48,36 +48,36 @@ import type {
* Retrieve a single contact record by its ID
* Retrieve a single contact record by its ID
* @summary Get contact by ID
* @summary Get contact by ID
*/
*/
export
type
getContactIdResponse200
=
{
export
type
get
ApiV10
ContactIdResponse200
=
{
data
:
GetContactId200
data
:
Get
ApiV10
ContactId200
status
:
200
status
:
200
}
}
export
type
getContactIdResponse404
=
{
export
type
get
ApiV10
ContactIdResponse404
=
{
data
:
void
data
:
void
status
:
404
status
:
404
}
}
export
type
get
ContactIdResponseSuccess
=
(
get
ContactIdResponse200
)
&
{
export
type
get
ApiV10ContactIdResponseSuccess
=
(
getApiV10
ContactIdResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
get
ContactIdResponseError
=
(
get
ContactIdResponse404
)
&
{
export
type
get
ApiV10ContactIdResponseError
=
(
getApiV10
ContactIdResponse404
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
get
ContactIdResponse
=
(
getContactIdResponseSuccess
|
get
ContactIdResponseError
)
export
type
get
ApiV10ContactIdResponse
=
(
getApiV10ContactIdResponseSuccess
|
getApiV10
ContactIdResponseError
)
export
const
getGetContactIdUrl
=
(
id
:
string
,)
=>
{
export
const
getGet
ApiV10
ContactIdUrl
=
(
id
:
string
,)
=>
{
return
`/contact/
${
id
}
`
return
`/
api/v1.0/
contact/
${
id
}
`
}
}
export
const
get
ContactId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
get
ContactIdResponse
>
=>
{
export
const
get
ApiV10ContactId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
getApiV10
ContactIdResponse
>
=>
{
const
res
=
await
fetch
(
getGetContactIdUrl
(
id
),
const
res
=
await
fetch
(
getGet
ApiV10
ContactIdUrl
(
id
),
{
{
...
options
,
...
options
,
method
:
'GET'
method
:
'GET'
...
@@ -88,83 +88,83 @@ export const getContactId = async (id: string, options?: RequestInit): Promise<g
...
@@ -88,83 +88,83 @@ export const getContactId = async (id: string, options?: RequestInit): Promise<g
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
getContactIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
get
ApiV10
ContactIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
getContactIdResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
get
ApiV10
ContactIdResponse
}
}
export
const
getGetContactIdInfiniteQueryKey
=
(
id
?:
string
,)
=>
{
export
const
getGet
ApiV10
ContactIdInfiniteQueryKey
=
(
id
?:
string
,)
=>
{
return
[
return
[
'infinite'
,
`/contact/
${
id
}
`
'infinite'
,
`/
api/v1.0/
contact/
${
id
}
`
]
as
const
;
]
as
const
;
}
}
export
const
getGetContactIdQueryKey
=
(
id
?:
string
,)
=>
{
export
const
getGet
ApiV10
ContactIdQueryKey
=
(
id
?:
string
,)
=>
{
return
[
return
[
`/contact/
${
id
}
`
`/
api/v1.0/
contact/
${
id
}
`
]
as
const
;
]
as
const
;
}
}
export
const
getGet
ContactIdInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getContactId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10ContactIdInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10ContactId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetContactIdInfiniteQueryKey
(
id
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
ContactIdInfiniteQueryKey
(
id
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ContactId
>>>
=
({
signal
})
=>
get
ContactId
(
id
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10ContactId
>>>
=
({
signal
})
=>
getApiV10
ContactId
(
id
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
ContactIdInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
ContactId
>>>
export
type
Get
ApiV10ContactIdInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>>
export
type
GetContactIdInfiniteQueryError
=
void
export
type
Get
ApiV10
ContactIdInfiniteQueryError
=
void
export
function
useGet
ContactIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
ContactId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10ContactIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>>
,
TError
=
void
>
(
id
:
string
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getContactId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
ContactIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
ContactId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10ContactIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getContactId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
ContactIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
ContactId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10ContactIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get contact by ID
* @summary Get contact by ID
*/
*/
export
function
useGet
ContactIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
ContactId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10ContactIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetContactIdInfiniteQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
ContactIdInfiniteQueryOptions
(
id
,
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -176,12 +176,12 @@ export function useGetContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<
...
@@ -176,12 +176,12 @@ export function useGetContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<
/**
/**
* @summary Get contact by ID
* @summary Get contact by ID
*/
*/
export
const
prefetchGet
ContactIdInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
ContactId
>>
,
TError
=
void
>
(
export
const
prefetchGet
ApiV10ContactIdInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>
,
TError
=
void
>
(
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetContactIdInfiniteQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
ContactIdInfiniteQueryOptions
(
id
,
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
...
@@ -190,62 +190,62 @@ export const prefetchGetContactIdInfiniteQuery = async <TData = Awaited<ReturnTy
...
@@ -190,62 +190,62 @@ export const prefetchGetContactIdInfiniteQuery = async <TData = Awaited<ReturnTy
export
const
getGet
ContactIdQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10ContactIdQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10ContactId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetContactIdQueryKey
(
id
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
ContactIdQueryKey
(
id
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ContactId
>>>
=
({
signal
})
=>
get
ContactId
(
id
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10ContactId
>>>
=
({
signal
})
=>
getApiV10
ContactId
(
id
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
ContactIdQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
ContactId
>>>
export
type
Get
ApiV10ContactIdQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>>
export
type
GetContactIdQueryError
=
void
export
type
Get
ApiV10
ContactIdQueryError
=
void
export
function
useGet
ContactId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
ContactId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10ContactId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>
,
TError
=
void
>
(
id
:
string
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getContactId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
ContactId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
ContactId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10ContactId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getContactId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
ContactId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
ContactId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10ContactId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get contact by ID
* @summary Get contact by ID
*/
*/
export
function
useGet
ContactId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
ContactId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10ContactId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetContactIdQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
ContactIdQueryOptions
(
id
,
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -257,12 +257,12 @@ export function useGetContactId<TData = Awaited<ReturnType<typeof getContactId>>
...
@@ -257,12 +257,12 @@ export function useGetContactId<TData = Awaited<ReturnType<typeof getContactId>>
/**
/**
* @summary Get contact by ID
* @summary Get contact by ID
*/
*/
export
const
prefetchGet
ContactIdQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
ContactId
>>
,
TError
=
void
>
(
export
const
prefetchGet
ApiV10ContactIdQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
ContactId
>>
,
TError
=
void
>
(
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
ContactId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetContactIdQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
ContactIdQueryOptions
(
id
,
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
await
queryClient
.
prefetchQuery
(
queryOptions
);
...
@@ -275,37 +275,37 @@ export const prefetchGetContactIdQuery = async <TData = Awaited<ReturnType<typeo
...
@@ -275,37 +275,37 @@ export const prefetchGetContactIdQuery = async <TData = Awaited<ReturnType<typeo
* Update a single contact record by its ID
* Update a single contact record by its ID
* @summary Update contact by ID
* @summary Update contact by ID
*/
*/
export
type
putContactIdResponse200
=
{
export
type
put
ApiV10
ContactIdResponse200
=
{
data
:
PutContactId200
data
:
Put
ApiV10
ContactId200
status
:
200
status
:
200
}
}
export
type
putContactIdResponse404
=
{
export
type
put
ApiV10
ContactIdResponse404
=
{
data
:
void
data
:
void
status
:
404
status
:
404
}
}
export
type
put
ContactIdResponseSuccess
=
(
put
ContactIdResponse200
)
&
{
export
type
put
ApiV10ContactIdResponseSuccess
=
(
putApiV10
ContactIdResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
put
ContactIdResponseError
=
(
put
ContactIdResponse404
)
&
{
export
type
put
ApiV10ContactIdResponseError
=
(
putApiV10
ContactIdResponse404
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
put
ContactIdResponse
=
(
putContactIdResponseSuccess
|
put
ContactIdResponseError
)
export
type
put
ApiV10ContactIdResponse
=
(
putApiV10ContactIdResponseSuccess
|
putApiV10
ContactIdResponseError
)
export
const
getPutContactIdUrl
=
(
id
:
string
,)
=>
{
export
const
getPut
ApiV10
ContactIdUrl
=
(
id
:
string
,)
=>
{
return
`/contact/
${
id
}
`
return
`/
api/v1.0/
contact/
${
id
}
`
}
}
export
const
putContactId
=
async
(
id
:
string
,
export
const
put
ApiV10
ContactId
=
async
(
id
:
string
,
contactMutate
:
ContactMutate
,
options
?:
RequestInit
):
Promise
<
putContactIdResponse
>
=>
{
contactMutate
:
ContactMutate
,
options
?:
RequestInit
):
Promise
<
put
ApiV10
ContactIdResponse
>
=>
{
const
res
=
await
fetch
(
getPutContactIdUrl
(
id
),
const
res
=
await
fetch
(
getPut
ApiV10
ContactIdUrl
(
id
),
{
{
...
options
,
...
options
,
method
:
'PUT'
,
method
:
'PUT'
,
...
@@ -317,18 +317,18 @@ export const putContactId = async (id: string,
...
@@ -317,18 +317,18 @@ export const putContactId = async (id: string,
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
putContactIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
put
ApiV10
ContactIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
putContactIdResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
put
ApiV10
ContactIdResponse
}
}
export
const
getPutContactIdMutationOptions
=
<
TError
=
void
,
export
const
getPut
ApiV10
ContactIdMutationOptions
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putContactId
>>
,
TError
,{
id
:
string
;
data
:
ContactMutate
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
ApiV10
ContactId
>>
,
TError
,{
id
:
string
;
data
:
ContactMutate
},
TContext
>
,
fetch
?:
RequestInit
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putContactId
>>
,
TError
,{
id
:
string
;
data
:
ContactMutate
},
TContext
>
=>
{
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
ApiV10
ContactId
>>
,
TError
,{
id
:
string
;
data
:
ContactMutate
},
TContext
>
=>
{
const
mutationKey
=
[
'putContactId'
];
const
mutationKey
=
[
'put
ApiV10
ContactId'
];
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
options
...
@@ -338,10 +338,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -338,10 +338,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
putContactId
>>
,
{
id
:
string
;
data
:
ContactMutate
}
>
=
(
props
)
=>
{
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
put
ApiV10
ContactId
>>
,
{
id
:
string
;
data
:
ContactMutate
}
>
=
(
props
)
=>
{
const
{
id
,
data
}
=
props
??
{};
const
{
id
,
data
}
=
props
??
{};
return
putContactId
(
id
,
data
,
fetchOptions
)
return
put
ApiV10
ContactId
(
id
,
data
,
fetchOptions
)
}
}
...
@@ -349,23 +349,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -349,23 +349,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
return
{
mutationFn
,
...
mutationOptions
}}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
Put
ContactIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
put
ContactId
>>>
export
type
Put
ApiV10ContactIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
putApiV10
ContactId
>>>
export
type
PutContactIdMutationBody
=
ContactMutate
export
type
Put
ApiV10
ContactIdMutationBody
=
ContactMutate
export
type
PutContactIdMutationError
=
void
export
type
Put
ApiV10
ContactIdMutationError
=
void
/**
/**
* @summary Update contact by ID
* @summary Update contact by ID
*/
*/
export
const
usePutContactId
=
<
TError
=
void
,
export
const
usePut
ApiV10
ContactId
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putContactId
>>
,
TError
,{
id
:
string
;
data
:
ContactMutate
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
ApiV10
ContactId
>>
,
TError
,{
id
:
string
;
data
:
ContactMutate
},
TContext
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
putContactId
>>
,
Awaited
<
ReturnType
<
typeof
put
ApiV10
ContactId
>>
,
TError
,
TError
,
{
id
:
string
;
data
:
ContactMutate
},
{
id
:
string
;
data
:
ContactMutate
},
TContext
TContext
>
=>
{
>
=>
{
const
mutationOptions
=
getPutContactIdMutationOptions
(
options
);
const
mutationOptions
=
getPut
ApiV10
ContactIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
}
...
@@ -373,36 +373,36 @@ export const usePutContactId = <TError = void,
...
@@ -373,36 +373,36 @@ export const usePutContactId = <TError = void,
* Delete a single contact record by its ID
* Delete a single contact record by its ID
* @summary Delete contact by ID
* @summary Delete contact by ID
*/
*/
export
type
deleteContactIdResponse200
=
{
export
type
delete
ApiV10
ContactIdResponse200
=
{
data
:
DeleteContactId200
data
:
Delete
ApiV10
ContactId200
status
:
200
status
:
200
}
}
export
type
deleteContactIdResponse404
=
{
export
type
delete
ApiV10
ContactIdResponse404
=
{
data
:
void
data
:
void
status
:
404
status
:
404
}
}
export
type
delete
ContactIdResponseSuccess
=
(
delete
ContactIdResponse200
)
&
{
export
type
delete
ApiV10ContactIdResponseSuccess
=
(
deleteApiV10
ContactIdResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
delete
ContactIdResponseError
=
(
delete
ContactIdResponse404
)
&
{
export
type
delete
ApiV10ContactIdResponseError
=
(
deleteApiV10
ContactIdResponse404
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
delete
ContactIdResponse
=
(
deleteContactIdResponseSuccess
|
delete
ContactIdResponseError
)
export
type
delete
ApiV10ContactIdResponse
=
(
deleteApiV10ContactIdResponseSuccess
|
deleteApiV10
ContactIdResponseError
)
export
const
getDeleteContactIdUrl
=
(
id
:
string
,)
=>
{
export
const
getDelete
ApiV10
ContactIdUrl
=
(
id
:
string
,)
=>
{
return
`/contact/
${
id
}
`
return
`/
api/v1.0/
contact/
${
id
}
`
}
}
export
const
delete
ContactId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
delete
ContactIdResponse
>
=>
{
export
const
delete
ApiV10ContactId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
deleteApiV10
ContactIdResponse
>
=>
{
const
res
=
await
fetch
(
getDeleteContactIdUrl
(
id
),
const
res
=
await
fetch
(
getDelete
ApiV10
ContactIdUrl
(
id
),
{
{
...
options
,
...
options
,
method
:
'DELETE'
method
:
'DELETE'
...
@@ -413,18 +413,18 @@ export const deleteContactId = async (id: string, options?: RequestInit): Promis
...
@@ -413,18 +413,18 @@ export const deleteContactId = async (id: string, options?: RequestInit): Promis
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
deleteContactIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
delete
ApiV10
ContactIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
deleteContactIdResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
delete
ApiV10
ContactIdResponse
}
}
export
const
getDeleteContactIdMutationOptions
=
<
TError
=
void
,
export
const
getDelete
ApiV10
ContactIdMutationOptions
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteContactId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
ContactId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteContactId
>>
,
TError
,{
id
:
string
},
TContext
>
=>
{
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
ContactId
>>
,
TError
,{
id
:
string
},
TContext
>
=>
{
const
mutationKey
=
[
'deleteContactId'
];
const
mutationKey
=
[
'delete
ApiV10
ContactId'
];
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
options
...
@@ -434,10 +434,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -434,10 +434,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
deleteContactId
>>
,
{
id
:
string
}
>
=
(
props
)
=>
{
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
ContactId
>>
,
{
id
:
string
}
>
=
(
props
)
=>
{
const
{
id
}
=
props
??
{};
const
{
id
}
=
props
??
{};
return
deleteContactId
(
id
,
fetchOptions
)
return
delete
ApiV10
ContactId
(
id
,
fetchOptions
)
}
}
...
@@ -445,23 +445,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -445,23 +445,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
return
{
mutationFn
,
...
mutationOptions
}}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
Delete
ContactIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
delete
ContactId
>>>
export
type
Delete
ApiV10ContactIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
deleteApiV10
ContactId
>>>
export
type
DeleteContactIdMutationError
=
void
export
type
Delete
ApiV10
ContactIdMutationError
=
void
/**
/**
* @summary Delete contact by ID
* @summary Delete contact by ID
*/
*/
export
const
useDeleteContactId
=
<
TError
=
void
,
export
const
useDelete
ApiV10
ContactId
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteContactId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
ContactId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
deleteContactId
>>
,
Awaited
<
ReturnType
<
typeof
delete
ApiV10
ContactId
>>
,
TError
,
TError
,
{
id
:
string
},
{
id
:
string
},
TContext
TContext
>
=>
{
>
=>
{
const
mutationOptions
=
getDeleteContactIdMutationOptions
(
options
);
const
mutationOptions
=
getDelete
ApiV10
ContactIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
}
...
@@ -469,19 +469,19 @@ export const useDeleteContactId = <TError = void,
...
@@ -469,19 +469,19 @@ export const useDeleteContactId = <TError = void,
* Retrieve a list of contact with pagination, filtering and sorting
* Retrieve a list of contact with pagination, filtering and sorting
* @summary Get all contact
* @summary Get all contact
*/
*/
export
type
getContactResponse200
=
{
export
type
get
ApiV10
ContactResponse200
=
{
data
:
ResponseGetAllData
data
:
ResponseGetAllData
status
:
200
status
:
200
}
}
export
type
get
ContactResponseSuccess
=
(
get
ContactResponse200
)
&
{
export
type
get
ApiV10ContactResponseSuccess
=
(
getApiV10
ContactResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
;
;
export
type
get
ContactResponse
=
(
get
ContactResponseSuccess
)
export
type
get
ApiV10ContactResponse
=
(
getApiV10
ContactResponseSuccess
)
export
const
getGet
ContactUrl
=
(
params
?:
Get
ContactParams
,)
=>
{
export
const
getGet
ApiV10ContactUrl
=
(
params
?:
GetApiV10
ContactParams
,)
=>
{
const
normalizedParams
=
new
URLSearchParams
();
const
normalizedParams
=
new
URLSearchParams
();
Object
.
entries
(
params
||
{}).
forEach
(([
key
,
value
])
=>
{
Object
.
entries
(
params
||
{}).
forEach
(([
key
,
value
])
=>
{
...
@@ -493,12 +493,12 @@ export const getGetContactUrl = (params?: GetContactParams,) => {
...
@@ -493,12 +493,12 @@ export const getGetContactUrl = (params?: GetContactParams,) => {
const
stringifiedParams
=
normalizedParams
.
toString
();
const
stringifiedParams
=
normalizedParams
.
toString
();
return
stringifiedParams
.
length
>
0
?
`/
contact?
${
stringifiedParams
}
`
:
`
/contact`
return
stringifiedParams
.
length
>
0
?
`/
api/v1.0/contact?
${
stringifiedParams
}
`
:
`/api/v1.0
/contact`
}
}
export
const
get
Contact
=
async
(
params
?:
GetContactParams
,
options
?:
RequestInit
):
Promise
<
get
ContactResponse
>
=>
{
export
const
get
ApiV10Contact
=
async
(
params
?:
GetApiV10ContactParams
,
options
?:
RequestInit
):
Promise
<
getApiV10
ContactResponse
>
=>
{
const
res
=
await
fetch
(
getGetContactUrl
(
params
),
const
res
=
await
fetch
(
getGet
ApiV10
ContactUrl
(
params
),
{
{
...
options
,
...
options
,
method
:
'GET'
method
:
'GET'
...
@@ -509,83 +509,83 @@ export const getContact = async (params?: GetContactParams, options?: RequestIni
...
@@ -509,83 +509,83 @@ export const getContact = async (params?: GetContactParams, options?: RequestIni
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
getContactResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
get
ApiV10
ContactResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
getContactResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
get
ApiV10
ContactResponse
}
}
export
const
getGet
ContactInfiniteQueryKey
=
(
params
?:
Get
ContactParams
,)
=>
{
export
const
getGet
ApiV10ContactInfiniteQueryKey
=
(
params
?:
GetApiV10
ContactParams
,)
=>
{
return
[
return
[
'infinite'
,
`/contact`
,
...(
params
?
[
params
]:
[])
'infinite'
,
`/
api/v1.0/
contact`
,
...(
params
?
[
params
]:
[])
]
as
const
;
]
as
const
;
}
}
export
const
getGet
ContactQueryKey
=
(
params
?:
Get
ContactParams
,)
=>
{
export
const
getGet
ApiV10ContactQueryKey
=
(
params
?:
GetApiV10
ContactParams
,)
=>
{
return
[
return
[
`/contact`
,
...(
params
?
[
params
]:
[])
`/
api/v1.0/
contact`
,
...(
params
?
[
params
]:
[])
]
as
const
;
]
as
const
;
}
}
export
const
getGet
ContactInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getContact
>>>
,
TError
=
unknown
>
(
params
?:
GetContactParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10ContactInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10Contact
>>>
,
TError
=
unknown
>
(
params
?:
GetApiV10ContactParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetContactInfiniteQueryKey
(
params
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
ContactInfiniteQueryKey
(
params
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>>
=
({
signal
})
=>
get
Contact
(
params
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10Contact
>>>
=
({
signal
})
=>
getApiV10
Contact
(
params
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContact
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
Contact
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
ContactInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>>
export
type
Get
ApiV10ContactInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>>
export
type
GetContactInfiniteQueryError
=
unknown
export
type
Get
ApiV10
ContactInfiniteQueryError
=
unknown
export
function
useGet
ContactInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10ContactInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>>
,
TError
=
unknown
>
(
params
:
undefined
|
Get
ContactParams
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
&
Pick
<
params
:
undefined
|
Get
ApiV10ContactParams
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getContact
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
Contact
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getContact
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
Contact
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
ContactInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10ContactInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>>
,
TError
=
unknown
>
(
params
?:
Get
ContactParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
&
Pick
<
params
?:
Get
ApiV10ContactParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getContact
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
Contact
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getContact
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
Contact
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
ContactInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10ContactInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>>
,
TError
=
unknown
>
(
params
?:
Get
ContactParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10ContactParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get all contact
* @summary Get all contact
*/
*/
export
function
useGet
ContactInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10ContactInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>>
,
TError
=
unknown
>
(
params
?:
Get
ContactParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10ContactParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetContactInfiniteQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
ContactInfiniteQueryOptions
(
params
,
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -597,12 +597,12 @@ export function useGetContactInfinite<TData = InfiniteData<Awaited<ReturnType<ty
...
@@ -597,12 +597,12 @@ export function useGetContactInfinite<TData = InfiniteData<Awaited<ReturnType<ty
/**
/**
* @summary Get all contact
* @summary Get all contact
*/
*/
export
const
prefetchGet
ContactInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
=
unknown
>
(
export
const
prefetchGet
ApiV10ContactInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
=
unknown
>
(
queryClient
:
QueryClient
,
params
?:
Get
ContactParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
params
?:
Get
ApiV10ContactParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetContactInfiniteQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
ContactInfiniteQueryOptions
(
params
,
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
...
@@ -611,62 +611,62 @@ export const prefetchGetContactInfiniteQuery = async <TData = Awaited<ReturnType
...
@@ -611,62 +611,62 @@ export const prefetchGetContactInfiniteQuery = async <TData = Awaited<ReturnType
export
const
getGet
ContactQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getContact
>>
,
TError
=
unknown
>
(
params
?:
GetContactParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10ContactQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10Contact
>>
,
TError
=
unknown
>
(
params
?:
GetApiV10ContactParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetContactQueryKey
(
params
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
ContactQueryKey
(
params
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>>
=
({
signal
})
=>
get
Contact
(
params
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10Contact
>>>
=
({
signal
})
=>
getApiV10
Contact
(
params
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getContact
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
Contact
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
ContactQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>>
export
type
Get
ApiV10ContactQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>>
export
type
GetContactQueryError
=
unknown
export
type
Get
ApiV10
ContactQueryError
=
unknown
export
function
useGet
Contact
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10Contact
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
=
unknown
>
(
params
:
undefined
|
Get
ContactParams
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
&
Pick
<
params
:
undefined
|
Get
ApiV10ContactParams
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getContact
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
Contact
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getContact
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
Contact
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
Contact
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10Contact
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
=
unknown
>
(
params
?:
Get
ContactParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
&
Pick
<
params
?:
Get
ApiV10ContactParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getContact
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
Contact
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getContact
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
Contact
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
Contact
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10Contact
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
=
unknown
>
(
params
?:
Get
ContactParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10ContactParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get all contact
* @summary Get all contact
*/
*/
export
function
useGet
Contact
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10Contact
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
=
unknown
>
(
params
?:
Get
ContactParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10ContactParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetContactQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
ContactQueryOptions
(
params
,
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -678,12 +678,12 @@ export function useGetContact<TData = Awaited<ReturnType<typeof getContact>>, TE
...
@@ -678,12 +678,12 @@ export function useGetContact<TData = Awaited<ReturnType<typeof getContact>>, TE
/**
/**
* @summary Get all contact
* @summary Get all contact
*/
*/
export
const
prefetchGet
ContactQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
=
unknown
>
(
export
const
prefetchGet
ApiV10ContactQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
=
unknown
>
(
queryClient
:
QueryClient
,
params
?:
Get
ContactParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
params
?:
Get
ApiV10ContactParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
Contact
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetContactQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
ContactQueryOptions
(
params
,
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
await
queryClient
.
prefetchQuery
(
queryOptions
);
...
@@ -696,29 +696,29 @@ export const prefetchGetContactQuery = async <TData = Awaited<ReturnType<typeof
...
@@ -696,29 +696,29 @@ export const prefetchGetContactQuery = async <TData = Awaited<ReturnType<typeof
* Create a new contact record
* Create a new contact record
* @summary Create a contact
* @summary Create a contact
*/
*/
export
type
postContactResponse200
=
{
export
type
post
ApiV10
ContactResponse200
=
{
data
:
PostContact200
data
:
Post
ApiV10
Contact200
status
:
200
status
:
200
}
}
export
type
post
ContactResponseSuccess
=
(
post
ContactResponse200
)
&
{
export
type
post
ApiV10ContactResponseSuccess
=
(
postApiV10
ContactResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
;
;
export
type
post
ContactResponse
=
(
post
ContactResponseSuccess
)
export
type
post
ApiV10ContactResponse
=
(
postApiV10
ContactResponseSuccess
)
export
const
getPostContactUrl
=
()
=>
{
export
const
getPost
ApiV10
ContactUrl
=
()
=>
{
return
`/contact`
return
`/
api/v1.0/
contact`
}
}
export
const
post
Contact
=
async
(
contactMutate
:
ContactMutate
,
options
?:
RequestInit
):
Promise
<
post
ContactResponse
>
=>
{
export
const
post
ApiV10Contact
=
async
(
contactMutate
:
ContactMutate
,
options
?:
RequestInit
):
Promise
<
postApiV10
ContactResponse
>
=>
{
const
res
=
await
fetch
(
getPostContactUrl
(),
const
res
=
await
fetch
(
getPost
ApiV10
ContactUrl
(),
{
{
...
options
,
...
options
,
method
:
'POST'
,
method
:
'POST'
,
...
@@ -730,18 +730,18 @@ export const postContact = async (contactMutate: ContactMutate, options?: Reques
...
@@ -730,18 +730,18 @@ export const postContact = async (contactMutate: ContactMutate, options?: Reques
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
postContactResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
post
ApiV10
ContactResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
postContactResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
post
ApiV10
ContactResponse
}
}
export
const
getPostContactMutationOptions
=
<
TError
=
unknown
,
export
const
getPost
ApiV10
ContactMutationOptions
=
<
TError
=
unknown
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postContact
>>
,
TError
,{
data
:
ContactMutate
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
ApiV10
Contact
>>
,
TError
,{
data
:
ContactMutate
},
TContext
>
,
fetch
?:
RequestInit
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postContact
>>
,
TError
,{
data
:
ContactMutate
},
TContext
>
=>
{
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
ApiV10
Contact
>>
,
TError
,{
data
:
ContactMutate
},
TContext
>
=>
{
const
mutationKey
=
[
'postContact'
];
const
mutationKey
=
[
'post
ApiV10
Contact'
];
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
options
...
@@ -751,10 +751,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -751,10 +751,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
postContact
>>
,
{
data
:
ContactMutate
}
>
=
(
props
)
=>
{
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
post
ApiV10
Contact
>>
,
{
data
:
ContactMutate
}
>
=
(
props
)
=>
{
const
{
data
}
=
props
??
{};
const
{
data
}
=
props
??
{};
return
postContact
(
data
,
fetchOptions
)
return
post
ApiV10
Contact
(
data
,
fetchOptions
)
}
}
...
@@ -762,23 +762,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -762,23 +762,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
return
{
mutationFn
,
...
mutationOptions
}}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
Post
ContactMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
post
Contact
>>>
export
type
Post
ApiV10ContactMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
postApiV10
Contact
>>>
export
type
PostContactMutationBody
=
ContactMutate
export
type
Post
ApiV10
ContactMutationBody
=
ContactMutate
export
type
PostContactMutationError
=
unknown
export
type
Post
ApiV10
ContactMutationError
=
unknown
/**
/**
* @summary Create a contact
* @summary Create a contact
*/
*/
export
const
usePostContact
=
<
TError
=
unknown
,
export
const
usePost
ApiV10
Contact
=
<
TError
=
unknown
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postContact
>>
,
TError
,{
data
:
ContactMutate
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
ApiV10
Contact
>>
,
TError
,{
data
:
ContactMutate
},
TContext
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
postContact
>>
,
Awaited
<
ReturnType
<
typeof
post
ApiV10
Contact
>>
,
TError
,
TError
,
{
data
:
ContactMutate
},
{
data
:
ContactMutate
},
TContext
TContext
>
=>
{
>
=>
{
const
mutationOptions
=
getPostContactMutationOptions
(
options
);
const
mutationOptions
=
getPost
ApiV10
ContactMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
}
src/api/endpoints/page-config.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
@@ -30,9 +30,9 @@ import type {
...
@@ -30,9 +30,9 @@ import type {
}
from
'@tanstack/react-query'
;
}
from
'@tanstack/react-query'
;
import
type
{
import
type
{
GetPageConfigParams
,
Get
ApiV10
PageConfigParams
,
PostPageConfigBody
,
Post
ApiV10
PageConfigBody
,
PutPageConfigIdBody
Put
ApiV10
PageConfigIdBody
}
from
'../models'
;
}
from
'../models'
;
...
@@ -44,36 +44,36 @@ import type {
...
@@ -44,36 +44,36 @@ import type {
* Retrieve hierarchical page config by its ID
* Retrieve hierarchical page config by its ID
* @summary Get hierarchical pageConfig by ID
* @summary Get hierarchical pageConfig by ID
*/
*/
export
type
getPageConfigIdResponse200
=
{
export
type
get
ApiV10
PageConfigIdResponse200
=
{
data
:
void
data
:
void
status
:
200
status
:
200
}
}
export
type
getPageConfigIdResponse404
=
{
export
type
get
ApiV10
PageConfigIdResponse404
=
{
data
:
void
data
:
void
status
:
404
status
:
404
}
}
export
type
get
PageConfigIdResponseSuccess
=
(
get
PageConfigIdResponse200
)
&
{
export
type
get
ApiV10PageConfigIdResponseSuccess
=
(
getApiV10
PageConfigIdResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
get
PageConfigIdResponseError
=
(
get
PageConfigIdResponse404
)
&
{
export
type
get
ApiV10PageConfigIdResponseError
=
(
getApiV10
PageConfigIdResponse404
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
get
PageConfigIdResponse
=
(
getPageConfigIdResponseSuccess
|
get
PageConfigIdResponseError
)
export
type
get
ApiV10PageConfigIdResponse
=
(
getApiV10PageConfigIdResponseSuccess
|
getApiV10
PageConfigIdResponseError
)
export
const
getGetPageConfigIdUrl
=
(
id
:
string
,)
=>
{
export
const
getGet
ApiV10
PageConfigIdUrl
=
(
id
:
string
,)
=>
{
return
`/pageConfig/
${
id
}
`
return
`/
api/v1.0/
pageConfig/
${
id
}
`
}
}
export
const
get
PageConfigId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
get
PageConfigIdResponse
>
=>
{
export
const
get
ApiV10PageConfigId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
getApiV10
PageConfigIdResponse
>
=>
{
const
res
=
await
fetch
(
getGetPageConfigIdUrl
(
id
),
const
res
=
await
fetch
(
getGet
ApiV10
PageConfigIdUrl
(
id
),
{
{
...
options
,
...
options
,
method
:
'GET'
method
:
'GET'
...
@@ -84,83 +84,83 @@ export const getPageConfigId = async (id: string, options?: RequestInit): Promis
...
@@ -84,83 +84,83 @@ export const getPageConfigId = async (id: string, options?: RequestInit): Promis
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
getPageConfigIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
get
ApiV10
PageConfigIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
getPageConfigIdResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
get
ApiV10
PageConfigIdResponse
}
}
export
const
getGetPageConfigIdInfiniteQueryKey
=
(
id
?:
string
,)
=>
{
export
const
getGet
ApiV10
PageConfigIdInfiniteQueryKey
=
(
id
?:
string
,)
=>
{
return
[
return
[
'infinite'
,
`/pageConfig/
${
id
}
`
'infinite'
,
`/
api/v1.0/
pageConfig/
${
id
}
`
]
as
const
;
]
as
const
;
}
}
export
const
getGetPageConfigIdQueryKey
=
(
id
?:
string
,)
=>
{
export
const
getGet
ApiV10
PageConfigIdQueryKey
=
(
id
?:
string
,)
=>
{
return
[
return
[
`/pageConfig/
${
id
}
`
`/
api/v1.0/
pageConfig/
${
id
}
`
]
as
const
;
]
as
const
;
}
}
export
const
getGet
PageConfigIdInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10PageConfigIdInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10PageConfigId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetPageConfigIdInfiniteQueryKey
(
id
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
PageConfigIdInfiniteQueryKey
(
id
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>>
=
({
signal
})
=>
get
PageConfigId
(
id
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10PageConfigId
>>>
=
({
signal
})
=>
getApiV10
PageConfigId
(
id
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
PageConfigIdInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>>
export
type
Get
ApiV10PageConfigIdInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>>
export
type
GetPageConfigIdInfiniteQueryError
=
void
export
type
Get
ApiV10
PageConfigIdInfiniteQueryError
=
void
export
function
useGet
PageConfigIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10PageConfigIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>>
,
TError
=
void
>
(
id
:
string
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
PageConfigIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10PageConfigIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
PageConfigIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10PageConfigIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get hierarchical pageConfig by ID
* @summary Get hierarchical pageConfig by ID
*/
*/
export
function
useGet
PageConfigIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>>
,
TError
=
void
>
(
export
function
useGet
ApiV10PageConfigIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetPageConfigIdInfiniteQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
PageConfigIdInfiniteQueryOptions
(
id
,
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -172,12 +172,12 @@ export function useGetPageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnTy
...
@@ -172,12 +172,12 @@ export function useGetPageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnTy
/**
/**
* @summary Get hierarchical pageConfig by ID
* @summary Get hierarchical pageConfig by ID
*/
*/
export
const
prefetchGet
PageConfigIdInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>
,
TError
=
void
>
(
export
const
prefetchGet
ApiV10PageConfigIdInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>
,
TError
=
void
>
(
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetPageConfigIdInfiniteQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
PageConfigIdInfiniteQueryOptions
(
id
,
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
...
@@ -186,62 +186,62 @@ export const prefetchGetPageConfigIdInfiniteQuery = async <TData = Awaited<Retur
...
@@ -186,62 +186,62 @@ export const prefetchGetPageConfigIdInfiniteQuery = async <TData = Awaited<Retur
export
const
getGet
PageConfigIdQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10PageConfigIdQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10PageConfigId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetPageConfigIdQueryKey
(
id
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
PageConfigIdQueryKey
(
id
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>>
=
({
signal
})
=>
get
PageConfigId
(
id
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10PageConfigId
>>>
=
({
signal
})
=>
getApiV10
PageConfigId
(
id
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
PageConfigIdQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>>
export
type
Get
ApiV10PageConfigIdQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>>
export
type
GetPageConfigIdQueryError
=
void
export
type
Get
ApiV10
PageConfigIdQueryError
=
void
export
function
useGet
PageConfigId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10PageConfigId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>
,
TError
=
void
>
(
id
:
string
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
PageConfigId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10PageConfigId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>>
&
Pick
<
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
PageConfigId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10PageConfigId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get hierarchical pageConfig by ID
* @summary Get hierarchical pageConfig by ID
*/
*/
export
function
useGet
PageConfigId
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>
,
TError
=
void
>
(
export
function
useGet
ApiV10PageConfigId
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>
,
TError
=
void
>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetPageConfigIdQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
PageConfigIdQueryOptions
(
id
,
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -253,12 +253,12 @@ export function useGetPageConfigId<TData = Awaited<ReturnType<typeof getPageConf
...
@@ -253,12 +253,12 @@ export function useGetPageConfigId<TData = Awaited<ReturnType<typeof getPageConf
/**
/**
* @summary Get hierarchical pageConfig by ID
* @summary Get hierarchical pageConfig by ID
*/
*/
export
const
prefetchGet
PageConfigIdQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfigId
>>
,
TError
=
void
>
(
export
const
prefetchGet
ApiV10PageConfigIdQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfigId
>>
,
TError
=
void
>
(
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfigId
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetPageConfigIdQueryOptions
(
id
,
options
)
const
queryOptions
=
getGet
ApiV10
PageConfigIdQueryOptions
(
id
,
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
await
queryClient
.
prefetchQuery
(
queryOptions
);
...
@@ -271,60 +271,60 @@ export const prefetchGetPageConfigIdQuery = async <TData = Awaited<ReturnType<ty
...
@@ -271,60 +271,60 @@ export const prefetchGetPageConfigIdQuery = async <TData = Awaited<ReturnType<ty
* Update a single pageConfig record by its ID. level is computed if parent_id changes and must not be sent.
* Update a single pageConfig record by its ID. level is computed if parent_id changes and must not be sent.
* @summary Update pageConfig by ID
* @summary Update pageConfig by ID
*/
*/
export
type
putPageConfigIdResponse200
=
{
export
type
put
ApiV10
PageConfigIdResponse200
=
{
data
:
void
data
:
void
status
:
200
status
:
200
}
}
export
type
putPageConfigIdResponse404
=
{
export
type
put
ApiV10
PageConfigIdResponse404
=
{
data
:
void
data
:
void
status
:
404
status
:
404
}
}
export
type
put
PageConfigIdResponseSuccess
=
(
put
PageConfigIdResponse200
)
&
{
export
type
put
ApiV10PageConfigIdResponseSuccess
=
(
putApiV10
PageConfigIdResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
put
PageConfigIdResponseError
=
(
put
PageConfigIdResponse404
)
&
{
export
type
put
ApiV10PageConfigIdResponseError
=
(
putApiV10
PageConfigIdResponse404
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
put
PageConfigIdResponse
=
(
putPageConfigIdResponseSuccess
|
put
PageConfigIdResponseError
)
export
type
put
ApiV10PageConfigIdResponse
=
(
putApiV10PageConfigIdResponseSuccess
|
putApiV10
PageConfigIdResponseError
)
export
const
getPutPageConfigIdUrl
=
(
id
:
string
,)
=>
{
export
const
getPut
ApiV10
PageConfigIdUrl
=
(
id
:
string
,)
=>
{
return
`/pageConfig/
${
id
}
`
return
`/
api/v1.0/
pageConfig/
${
id
}
`
}
}
export
const
putPageConfigId
=
async
(
id
:
string
,
export
const
put
ApiV10
PageConfigId
=
async
(
id
:
string
,
put
PageConfigIdBody
:
PutPageConfigIdBody
,
options
?:
RequestInit
):
Promise
<
put
PageConfigIdResponse
>
=>
{
put
ApiV10PageConfigIdBody
:
PutApiV10PageConfigIdBody
,
options
?:
RequestInit
):
Promise
<
putApiV10
PageConfigIdResponse
>
=>
{
const
res
=
await
fetch
(
getPutPageConfigIdUrl
(
id
),
const
res
=
await
fetch
(
getPut
ApiV10
PageConfigIdUrl
(
id
),
{
{
...
options
,
...
options
,
method
:
'PUT'
,
method
:
'PUT'
,
headers
:
{
'Content-Type'
:
'application/json'
,
...
options
?.
headers
},
headers
:
{
'Content-Type'
:
'application/json'
,
...
options
?.
headers
},
body
:
JSON
.
stringify
(
body
:
JSON
.
stringify
(
putPageConfigIdBody
,)
put
ApiV10
PageConfigIdBody
,)
}
}
)
)
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
putPageConfigIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
put
ApiV10
PageConfigIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
putPageConfigIdResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
put
ApiV10
PageConfigIdResponse
}
}
export
const
getPutPageConfigIdMutationOptions
=
<
TError
=
void
,
export
const
getPut
ApiV10
PageConfigIdMutationOptions
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
PageConfigId
>>
,
TError
,{
id
:
string
;
data
:
Put
PageConfigIdBody
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
ApiV10PageConfigId
>>
,
TError
,{
id
:
string
;
data
:
PutApiV10
PageConfigIdBody
},
TContext
>
,
fetch
?:
RequestInit
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
PageConfigId
>>
,
TError
,{
id
:
string
;
data
:
Put
PageConfigIdBody
},
TContext
>
=>
{
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
ApiV10PageConfigId
>>
,
TError
,{
id
:
string
;
data
:
PutApiV10
PageConfigIdBody
},
TContext
>
=>
{
const
mutationKey
=
[
'putPageConfigId'
];
const
mutationKey
=
[
'put
ApiV10
PageConfigId'
];
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
options
...
@@ -334,10 +334,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -334,10 +334,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
put
PageConfigId
>>
,
{
id
:
string
;
data
:
Put
PageConfigIdBody
}
>
=
(
props
)
=>
{
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
put
ApiV10PageConfigId
>>
,
{
id
:
string
;
data
:
PutApiV10
PageConfigIdBody
}
>
=
(
props
)
=>
{
const
{
id
,
data
}
=
props
??
{};
const
{
id
,
data
}
=
props
??
{};
return
putPageConfigId
(
id
,
data
,
fetchOptions
)
return
put
ApiV10
PageConfigId
(
id
,
data
,
fetchOptions
)
}
}
...
@@ -345,23 +345,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -345,23 +345,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
return
{
mutationFn
,
...
mutationOptions
}}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
Put
PageConfigIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
put
PageConfigId
>>>
export
type
Put
ApiV10PageConfigIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
putApiV10
PageConfigId
>>>
export
type
Put
PageConfigIdMutationBody
=
Put
PageConfigIdBody
export
type
Put
ApiV10PageConfigIdMutationBody
=
PutApiV10
PageConfigIdBody
export
type
PutPageConfigIdMutationError
=
void
export
type
Put
ApiV10
PageConfigIdMutationError
=
void
/**
/**
* @summary Update pageConfig by ID
* @summary Update pageConfig by ID
*/
*/
export
const
usePutPageConfigId
=
<
TError
=
void
,
export
const
usePut
ApiV10
PageConfigId
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
PageConfigId
>>
,
TError
,{
id
:
string
;
data
:
Put
PageConfigIdBody
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
put
ApiV10PageConfigId
>>
,
TError
,{
id
:
string
;
data
:
PutApiV10
PageConfigIdBody
},
TContext
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
putPageConfigId
>>
,
Awaited
<
ReturnType
<
typeof
put
ApiV10
PageConfigId
>>
,
TError
,
TError
,
{
id
:
string
;
data
:
PutPageConfigIdBody
},
{
id
:
string
;
data
:
Put
ApiV10
PageConfigIdBody
},
TContext
TContext
>
=>
{
>
=>
{
const
mutationOptions
=
getPutPageConfigIdMutationOptions
(
options
);
const
mutationOptions
=
getPut
ApiV10
PageConfigIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
}
...
@@ -369,36 +369,36 @@ export const usePutPageConfigId = <TError = void,
...
@@ -369,36 +369,36 @@ export const usePutPageConfigId = <TError = void,
* Delete a single pageConfig record by its ID
* Delete a single pageConfig record by its ID
* @summary Delete pageConfig by ID
* @summary Delete pageConfig by ID
*/
*/
export
type
deletePageConfigIdResponse200
=
{
export
type
delete
ApiV10
PageConfigIdResponse200
=
{
data
:
void
data
:
void
status
:
200
status
:
200
}
}
export
type
deletePageConfigIdResponse404
=
{
export
type
delete
ApiV10
PageConfigIdResponse404
=
{
data
:
void
data
:
void
status
:
404
status
:
404
}
}
export
type
delete
PageConfigIdResponseSuccess
=
(
delete
PageConfigIdResponse200
)
&
{
export
type
delete
ApiV10PageConfigIdResponseSuccess
=
(
deleteApiV10
PageConfigIdResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
delete
PageConfigIdResponseError
=
(
delete
PageConfigIdResponse404
)
&
{
export
type
delete
ApiV10PageConfigIdResponseError
=
(
deleteApiV10
PageConfigIdResponse404
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
export
type
delete
PageConfigIdResponse
=
(
deletePageConfigIdResponseSuccess
|
delete
PageConfigIdResponseError
)
export
type
delete
ApiV10PageConfigIdResponse
=
(
deleteApiV10PageConfigIdResponseSuccess
|
deleteApiV10
PageConfigIdResponseError
)
export
const
getDeletePageConfigIdUrl
=
(
id
:
string
,)
=>
{
export
const
getDelete
ApiV10
PageConfigIdUrl
=
(
id
:
string
,)
=>
{
return
`/pageConfig/
${
id
}
`
return
`/
api/v1.0/
pageConfig/
${
id
}
`
}
}
export
const
delete
PageConfigId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
delete
PageConfigIdResponse
>
=>
{
export
const
delete
ApiV10PageConfigId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
deleteApiV10
PageConfigIdResponse
>
=>
{
const
res
=
await
fetch
(
getDeletePageConfigIdUrl
(
id
),
const
res
=
await
fetch
(
getDelete
ApiV10
PageConfigIdUrl
(
id
),
{
{
...
options
,
...
options
,
method
:
'DELETE'
method
:
'DELETE'
...
@@ -409,18 +409,18 @@ export const deletePageConfigId = async (id: string, options?: RequestInit): Pro
...
@@ -409,18 +409,18 @@ export const deletePageConfigId = async (id: string, options?: RequestInit): Pro
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
deletePageConfigIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
delete
ApiV10
PageConfigIdResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
deletePageConfigIdResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
delete
ApiV10
PageConfigIdResponse
}
}
export
const
getDeletePageConfigIdMutationOptions
=
<
TError
=
void
,
export
const
getDelete
ApiV10
PageConfigIdMutationOptions
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deletePageConfigId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
PageConfigId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deletePageConfigId
>>
,
TError
,{
id
:
string
},
TContext
>
=>
{
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
PageConfigId
>>
,
TError
,{
id
:
string
},
TContext
>
=>
{
const
mutationKey
=
[
'deletePageConfigId'
];
const
mutationKey
=
[
'delete
ApiV10
PageConfigId'
];
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
options
...
@@ -430,10 +430,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -430,10 +430,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
deletePageConfigId
>>
,
{
id
:
string
}
>
=
(
props
)
=>
{
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
PageConfigId
>>
,
{
id
:
string
}
>
=
(
props
)
=>
{
const
{
id
}
=
props
??
{};
const
{
id
}
=
props
??
{};
return
deletePageConfigId
(
id
,
fetchOptions
)
return
delete
ApiV10
PageConfigId
(
id
,
fetchOptions
)
}
}
...
@@ -441,23 +441,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -441,23 +441,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
return
{
mutationFn
,
...
mutationOptions
}}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
Delete
PageConfigIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
delete
PageConfigId
>>>
export
type
Delete
ApiV10PageConfigIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
deleteApiV10
PageConfigId
>>>
export
type
DeletePageConfigIdMutationError
=
void
export
type
Delete
ApiV10
PageConfigIdMutationError
=
void
/**
/**
* @summary Delete pageConfig by ID
* @summary Delete pageConfig by ID
*/
*/
export
const
useDeletePageConfigId
=
<
TError
=
void
,
export
const
useDelete
ApiV10
PageConfigId
=
<
TError
=
void
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deletePageConfigId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
delete
ApiV10
PageConfigId
>>
,
TError
,{
id
:
string
},
TContext
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
deletePageConfigId
>>
,
Awaited
<
ReturnType
<
typeof
delete
ApiV10
PageConfigId
>>
,
TError
,
TError
,
{
id
:
string
},
{
id
:
string
},
TContext
TContext
>
=>
{
>
=>
{
const
mutationOptions
=
getDeletePageConfigIdMutationOptions
(
options
);
const
mutationOptions
=
getDelete
ApiV10
PageConfigIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
}
...
@@ -465,19 +465,19 @@ export const useDeletePageConfigId = <TError = void,
...
@@ -465,19 +465,19 @@ export const useDeletePageConfigId = <TError = void,
* Retrieve hierarchical page config by id, static_link, or code. If no parameters are provided, returns the root hierarchical structure.
* Retrieve hierarchical page config by id, static_link, or code. If no parameters are provided, returns the root hierarchical structure.
* @summary Get hierarchical pageConfig
* @summary Get hierarchical pageConfig
*/
*/
export
type
getPageConfigResponse200
=
{
export
type
get
ApiV10
PageConfigResponse200
=
{
data
:
void
data
:
void
status
:
200
status
:
200
}
}
export
type
get
PageConfigResponseSuccess
=
(
get
PageConfigResponse200
)
&
{
export
type
get
ApiV10PageConfigResponseSuccess
=
(
getApiV10
PageConfigResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
;
;
export
type
get
PageConfigResponse
=
(
get
PageConfigResponseSuccess
)
export
type
get
ApiV10PageConfigResponse
=
(
getApiV10
PageConfigResponseSuccess
)
export
const
getGet
PageConfigUrl
=
(
params
?:
Get
PageConfigParams
,)
=>
{
export
const
getGet
ApiV10PageConfigUrl
=
(
params
?:
GetApiV10
PageConfigParams
,)
=>
{
const
normalizedParams
=
new
URLSearchParams
();
const
normalizedParams
=
new
URLSearchParams
();
Object
.
entries
(
params
||
{}).
forEach
(([
key
,
value
])
=>
{
Object
.
entries
(
params
||
{}).
forEach
(([
key
,
value
])
=>
{
...
@@ -489,12 +489,12 @@ export const getGetPageConfigUrl = (params?: GetPageConfigParams,) => {
...
@@ -489,12 +489,12 @@ export const getGetPageConfigUrl = (params?: GetPageConfigParams,) => {
const
stringifiedParams
=
normalizedParams
.
toString
();
const
stringifiedParams
=
normalizedParams
.
toString
();
return
stringifiedParams
.
length
>
0
?
`/
pageConfig?
${
stringifiedParams
}
`
:
`
/pageConfig`
return
stringifiedParams
.
length
>
0
?
`/
api/v1.0/pageConfig?
${
stringifiedParams
}
`
:
`/api/v1.0
/pageConfig`
}
}
export
const
get
PageConfig
=
async
(
params
?:
GetPageConfigParams
,
options
?:
RequestInit
):
Promise
<
get
PageConfigResponse
>
=>
{
export
const
get
ApiV10PageConfig
=
async
(
params
?:
GetApiV10PageConfigParams
,
options
?:
RequestInit
):
Promise
<
getApiV10
PageConfigResponse
>
=>
{
const
res
=
await
fetch
(
getGetPageConfigUrl
(
params
),
const
res
=
await
fetch
(
getGet
ApiV10
PageConfigUrl
(
params
),
{
{
...
options
,
...
options
,
method
:
'GET'
method
:
'GET'
...
@@ -505,83 +505,83 @@ export const getPageConfig = async (params?: GetPageConfigParams, options?: Requ
...
@@ -505,83 +505,83 @@ export const getPageConfig = async (params?: GetPageConfigParams, options?: Requ
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
getPageConfigResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
get
ApiV10
PageConfigResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
getPageConfigResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
get
ApiV10
PageConfigResponse
}
}
export
const
getGet
PageConfigInfiniteQueryKey
=
(
params
?:
Get
PageConfigParams
,)
=>
{
export
const
getGet
ApiV10PageConfigInfiniteQueryKey
=
(
params
?:
GetApiV10
PageConfigParams
,)
=>
{
return
[
return
[
'infinite'
,
`/pageConfig`
,
...(
params
?
[
params
]:
[])
'infinite'
,
`/
api/v1.0/
pageConfig`
,
...(
params
?
[
params
]:
[])
]
as
const
;
]
as
const
;
}
}
export
const
getGet
PageConfigQueryKey
=
(
params
?:
Get
PageConfigParams
,)
=>
{
export
const
getGet
ApiV10PageConfigQueryKey
=
(
params
?:
GetApiV10
PageConfigParams
,)
=>
{
return
[
return
[
`/pageConfig`
,
...(
params
?
[
params
]:
[])
`/
api/v1.0/
pageConfig`
,
...(
params
?
[
params
]:
[])
]
as
const
;
]
as
const
;
}
}
export
const
getGet
PageConfigInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getPageConfig
>>>
,
TError
=
unknown
>
(
params
?:
GetPageConfigParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10PageConfigInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10PageConfig
>>>
,
TError
=
unknown
>
(
params
?:
GetApiV10PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetPageConfigInfiniteQueryKey
(
params
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
PageConfigInfiniteQueryKey
(
params
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>>
=
({
signal
})
=>
get
PageConfig
(
params
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10PageConfig
>>>
=
({
signal
})
=>
getApiV10
PageConfig
(
params
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfig
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
PageConfigInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>>
export
type
Get
ApiV10PageConfigInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>>
export
type
GetPageConfigInfiniteQueryError
=
unknown
export
type
Get
ApiV10
PageConfigInfiniteQueryError
=
unknown
export
function
useGet
PageConfigInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10PageConfigInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>>
,
TError
=
unknown
>
(
params
:
undefined
|
Get
PageConfigParams
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
&
Pick
<
params
:
undefined
|
Get
ApiV10PageConfigParams
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfig
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfig
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
PageConfigInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10PageConfigInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>>
,
TError
=
unknown
>
(
params
?:
Get
PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
&
Pick
<
params
?:
Get
ApiV10PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfig
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfig
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
PageConfigInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10PageConfigInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>>
,
TError
=
unknown
>
(
params
?:
Get
PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get hierarchical pageConfig
* @summary Get hierarchical pageConfig
*/
*/
export
function
useGet
PageConfigInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10PageConfigInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>>
,
TError
=
unknown
>
(
params
?:
Get
PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetPageConfigInfiniteQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
PageConfigInfiniteQueryOptions
(
params
,
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -593,12 +593,12 @@ export function useGetPageConfigInfinite<TData = InfiniteData<Awaited<ReturnType
...
@@ -593,12 +593,12 @@ export function useGetPageConfigInfinite<TData = InfiniteData<Awaited<ReturnType
/**
/**
* @summary Get hierarchical pageConfig
* @summary Get hierarchical pageConfig
*/
*/
export
const
prefetchGet
PageConfigInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
=
unknown
>
(
export
const
prefetchGet
ApiV10PageConfigInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
=
unknown
>
(
queryClient
:
QueryClient
,
params
?:
Get
PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
params
?:
Get
ApiV10PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetPageConfigInfiniteQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
PageConfigInfiniteQueryOptions
(
params
,
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
...
@@ -607,62 +607,62 @@ export const prefetchGetPageConfigInfiniteQuery = async <TData = Awaited<ReturnT
...
@@ -607,62 +607,62 @@ export const prefetchGetPageConfigInfiniteQuery = async <TData = Awaited<ReturnT
export
const
getGet
PageConfigQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
,
TError
=
unknown
>
(
params
?:
GetPageConfigParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
export
const
getGet
ApiV10PageConfigQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10PageConfig
>>
,
TError
=
unknown
>
(
params
?:
GetApiV10PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
)
=>
{
)
=>
{
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
{
query
:
queryOptions
,
fetch
:
fetchOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetPageConfigQueryKey
(
params
);
const
queryKey
=
queryOptions
?.
queryKey
??
getGet
ApiV10
PageConfigQueryKey
(
params
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>>
=
({
signal
})
=>
get
PageConfig
(
params
,
{
signal
,
...
fetchOptions
});
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
get
ApiV10PageConfig
>>>
=
({
signal
})
=>
getApiV10
PageConfig
(
params
,
{
signal
,
...
fetchOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfig
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
}
export
type
Get
PageConfigQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>>
export
type
Get
ApiV10PageConfigQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>>
export
type
GetPageConfigQueryError
=
unknown
export
type
Get
ApiV10
PageConfigQueryError
=
unknown
export
function
useGet
PageConfig
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10PageConfig
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
=
unknown
>
(
params
:
undefined
|
Get
PageConfigParams
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
&
Pick
<
params
:
undefined
|
Get
ApiV10PageConfigParams
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfig
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfig
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
PageConfig
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10PageConfig
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
=
unknown
>
(
params
?:
Get
PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
&
Pick
<
params
?:
Get
ApiV10PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
,
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfig
>>
,
TError
,
TError
,
Awaited
<
ReturnType
<
typeof
getPageConfig
>>
Awaited
<
ReturnType
<
typeof
get
ApiV10
PageConfig
>>
>
,
'initialData'
>
,
'initialData'
>
,
fetch
?:
RequestInit
}
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGet
PageConfig
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10PageConfig
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
=
unknown
>
(
params
?:
Get
PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
/**
* @summary Get hierarchical pageConfig
* @summary Get hierarchical pageConfig
*/
*/
export
function
useGet
PageConfig
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
=
unknown
>
(
export
function
useGet
ApiV10PageConfig
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
=
unknown
>
(
params
?:
Get
PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
params
?:
Get
ApiV10PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetPageConfigQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
PageConfigQueryOptions
(
params
,
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
...
@@ -674,12 +674,12 @@ export function useGetPageConfig<TData = Awaited<ReturnType<typeof getPageConfig
...
@@ -674,12 +674,12 @@ export function useGetPageConfig<TData = Awaited<ReturnType<typeof getPageConfig
/**
/**
* @summary Get hierarchical pageConfig
* @summary Get hierarchical pageConfig
*/
*/
export
const
prefetchGet
PageConfigQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
=
unknown
>
(
export
const
prefetchGet
ApiV10PageConfigQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
=
unknown
>
(
queryClient
:
QueryClient
,
params
?:
Get
PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
get
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
queryClient
:
QueryClient
,
params
?:
Get
ApiV10PageConfigParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getApiV10
PageConfig
>>
,
TError
,
TData
>>
,
fetch
?:
RequestInit
}
):
Promise
<
QueryClient
>
=>
{
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetPageConfigQueryOptions
(
params
,
options
)
const
queryOptions
=
getGet
ApiV10
PageConfigQueryOptions
(
params
,
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
await
queryClient
.
prefetchQuery
(
queryOptions
);
...
@@ -692,52 +692,52 @@ export const prefetchGetPageConfigQuery = async <TData = Awaited<ReturnType<type
...
@@ -692,52 +692,52 @@ export const prefetchGetPageConfigQuery = async <TData = Awaited<ReturnType<type
* Create a new pageConfig record. parent_id is required. level is computed from parent and must not be sent.
* Create a new pageConfig record. parent_id is required. level is computed from parent and must not be sent.
* @summary Create a pageConfig
* @summary Create a pageConfig
*/
*/
export
type
postPageConfigResponse200
=
{
export
type
post
ApiV10
PageConfigResponse200
=
{
data
:
void
data
:
void
status
:
200
status
:
200
}
}
export
type
post
PageConfigResponseSuccess
=
(
post
PageConfigResponse200
)
&
{
export
type
post
ApiV10PageConfigResponseSuccess
=
(
postApiV10
PageConfigResponse200
)
&
{
headers
:
Headers
;
headers
:
Headers
;
};
};
;
;
export
type
post
PageConfigResponse
=
(
post
PageConfigResponseSuccess
)
export
type
post
ApiV10PageConfigResponse
=
(
postApiV10
PageConfigResponseSuccess
)
export
const
getPostPageConfigUrl
=
()
=>
{
export
const
getPost
ApiV10
PageConfigUrl
=
()
=>
{
return
`/pageConfig`
return
`/
api/v1.0/
pageConfig`
}
}
export
const
post
PageConfig
=
async
(
postPageConfigBody
:
PostPageConfigBody
,
options
?:
RequestInit
):
Promise
<
post
PageConfigResponse
>
=>
{
export
const
post
ApiV10PageConfig
=
async
(
postApiV10PageConfigBody
:
PostApiV10PageConfigBody
,
options
?:
RequestInit
):
Promise
<
postApiV10
PageConfigResponse
>
=>
{
const
res
=
await
fetch
(
getPostPageConfigUrl
(),
const
res
=
await
fetch
(
getPost
ApiV10
PageConfigUrl
(),
{
{
...
options
,
...
options
,
method
:
'POST'
,
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
,
...
options
?.
headers
},
headers
:
{
'Content-Type'
:
'application/json'
,
...
options
?.
headers
},
body
:
JSON
.
stringify
(
body
:
JSON
.
stringify
(
postPageConfigBody
,)
post
ApiV10
PageConfigBody
,)
}
}
)
)
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
body
=
[
204
,
205
,
304
].
includes
(
res
.
status
)
?
null
:
await
res
.
text
();
const
data
:
postPageConfigResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
const
data
:
post
ApiV10
PageConfigResponse
[
'data'
]
=
body
?
JSON
.
parse
(
body
)
:
{}
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
postPageConfigResponse
return
{
data
,
status
:
res
.
status
,
headers
:
res
.
headers
}
as
post
ApiV10
PageConfigResponse
}
}
export
const
getPostPageConfigMutationOptions
=
<
TError
=
unknown
,
export
const
getPost
ApiV10
PageConfigMutationOptions
=
<
TError
=
unknown
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
PageConfig
>>
,
TError
,{
data
:
Post
PageConfigBody
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
ApiV10PageConfig
>>
,
TError
,{
data
:
PostApiV10
PageConfigBody
},
TContext
>
,
fetch
?:
RequestInit
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
PageConfig
>>
,
TError
,{
data
:
Post
PageConfigBody
},
TContext
>
=>
{
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
ApiV10PageConfig
>>
,
TError
,{
data
:
PostApiV10
PageConfigBody
},
TContext
>
=>
{
const
mutationKey
=
[
'postPageConfig'
];
const
mutationKey
=
[
'post
ApiV10
PageConfig'
];
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
const
{
mutation
:
mutationOptions
,
fetch
:
fetchOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
options
...
@@ -747,10 +747,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -747,10 +747,10 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
post
PageConfig
>>
,
{
data
:
Post
PageConfigBody
}
>
=
(
props
)
=>
{
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
post
ApiV10PageConfig
>>
,
{
data
:
PostApiV10
PageConfigBody
}
>
=
(
props
)
=>
{
const
{
data
}
=
props
??
{};
const
{
data
}
=
props
??
{};
return
postPageConfig
(
data
,
fetchOptions
)
return
post
ApiV10
PageConfig
(
data
,
fetchOptions
)
}
}
...
@@ -758,23 +758,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
...
@@ -758,23 +758,23 @@ const {mutation: mutationOptions, fetch: fetchOptions} = options ?
return
{
mutationFn
,
...
mutationOptions
}}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
Post
PageConfigMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
post
PageConfig
>>>
export
type
Post
ApiV10PageConfigMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
postApiV10
PageConfig
>>>
export
type
Post
PageConfigMutationBody
=
Post
PageConfigBody
export
type
Post
ApiV10PageConfigMutationBody
=
PostApiV10
PageConfigBody
export
type
PostPageConfigMutationError
=
unknown
export
type
Post
ApiV10
PageConfigMutationError
=
unknown
/**
/**
* @summary Create a pageConfig
* @summary Create a pageConfig
*/
*/
export
const
usePostPageConfig
=
<
TError
=
unknown
,
export
const
usePost
ApiV10
PageConfig
=
<
TError
=
unknown
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
PageConfig
>>
,
TError
,{
data
:
Post
PageConfigBody
},
TContext
>
,
fetch
?:
RequestInit
}
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
post
ApiV10PageConfig
>>
,
TError
,{
data
:
PostApiV10
PageConfigBody
},
TContext
>
,
fetch
?:
RequestInit
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
postPageConfig
>>
,
Awaited
<
ReturnType
<
typeof
post
ApiV10
PageConfig
>>
,
TError
,
TError
,
{
data
:
PostPageConfigBody
},
{
data
:
Post
ApiV10
PageConfigBody
},
TContext
TContext
>
=>
{
>
=>
{
const
mutationOptions
=
getPostPageConfigMutationOptions
(
options
);
const
mutationOptions
=
getPost
ApiV10
PageConfigMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
}
src/api/models/apiResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/apiResponseResponseData.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/apiResponseViolationItem.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/badRequestResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/badRequestResponseError.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/badRequestResponseErrorMessage.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/badRequestResponseResponseData.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/badRequestResponseViolationItem.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/business.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessDeleteResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessDeleteResponseResponseData.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessDeleteResponseViolations.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessGetAllResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessGetAllResponseResponseData.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessGetAllResponseViolations.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessGetOneResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessGetOneResponseViolations.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessLogoSummary.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/businessUpdate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/category.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/categoryMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/categoryTag.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/categoryTagMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/categoryThumbnail.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/contact.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/contactMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/file.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/fileCompressInfo.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/fileImportInfo.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/fileMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/fileMutateCompressInfo.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/fileMutateImportInfo.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/filtersMutateParameter.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/filtersParameter.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/forgotPasswordResetRequest.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/forgotPasswordSendOtpRequest.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/forgotPasswordVerifyOtpRequest.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/forgotPasswordVerifyOtpResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/index.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/loginRequest.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/loginRequestDeviceInfo.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/loginResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/logo.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/logoCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/logoFile.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/logoMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/logoUpdate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/mediaAsset.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/mediaAssetMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/mediaAssetMutateVariants.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/mediaAssetVariants.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/memberCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/memberImportResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/memberImportWarningItem.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/memberUpdate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/migrationCheckpoint.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/migrationCheckpointErrorSummary.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/migrationCheckpointMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/migrationCheckpointMutateErrorSummary.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/migrationMapping.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/migrationMappingMetadata.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/migrationMappingMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/migrationMappingMutateMetadata.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/pageConfig.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/pageConfigCategory.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/pageConfigCategoryMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/pageConfigMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/pageConfigTag.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/pageConfigTagMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/pageParameter.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/pageSizeParameter.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/permission.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/permissionBulkCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/permissionBulkDelete.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/permissionCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/permissionMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/permissionUpdate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/position.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/positionMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/post.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/postCategory.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/postCategoryBulkCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/postCategoryMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/postContentStructure.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/postMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/postMutateContentStructure.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/postTag.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/postTagBulkCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/postTagMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/response.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/responseGetAllData.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/responseGetAllDataAllOf.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/responseGetAllDataAllOfResponseData.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/responseGetAllDataAllOfResponseDataRowsItem.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/responseResponseData.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/responseViolationItem.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/role.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/roleBulkCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/roleBulkDelete.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/roleCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/roleMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/roleMutatePermissions.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/rolePermission.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/rolePermissionBulkCreateByRole.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/rolePermissionBulkDelete.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/rolePermissionMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/roleUpdate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/schemaMigration.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/schemaMigrationMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/siteInformation.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/siteInformationData.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/siteInformationLinkSocials.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/siteInformationMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/siteInformationMutateLinkSocials.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/siteInformationResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/siteInformationResponseAllOf.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/siteInformationSocialLink.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/siteInformationUpdateBody.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/sortFieldParameter.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/sortOrderParameter.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/tag.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/tagListByIds.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/tagMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/term.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termCreateRequest.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termMember.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termMemberAvatar.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termMemberAvatarProperty.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termPosition.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termPositionMember.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termPositionMemberMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termPositionMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termPositionRequestItem.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termPositionResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/termUpdateRequest.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/unauthorizedResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/unauthorizedResponseError.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/unauthorizedResponseErrorMessage.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/unauthorizedResponseResponseData.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/unauthorizedResponseViolationItem.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/user.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userAuth.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userAuthMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userAuthMutatePasswordHistory.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userAuthPasswordHistory.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userChangePassword.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userCreateGender.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userCreateType.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userMeResponse.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRole.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRoleAssignedByUser.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRoleCreate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRoleListData.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRoleMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRoleRole.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRoleRoleSummary.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRoleUpdate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRoleUser.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRoleUserSummary.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userRoleUserSummaryType.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userSession.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userSessionDeviceInfo.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userSessionMutate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userSessionMutateDeviceInfo.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userUpdate.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userUpdateGender.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/models/userUpdateType.ts
View file @
edbc9f87
/**
/**
* Generated by orval v8.0.0-rc.0 🍺
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Do not edit manually.
*
Backend Template
API
*
VietProDev CMS Backend
API
* Generated API documentation
* Generated API documentation
* OpenAPI spec version: 1.0.0
* OpenAPI spec version: 1.0.0
*/
*/
...
...
src/api/mutator/custom-client.ts
View file @
edbc9f87
...
@@ -68,6 +68,20 @@ const createAxiosInstance = () => {
...
@@ -68,6 +68,20 @@ const createAxiosInstance = () => {
};
};
const
AXIOS_INSTANCE
=
createAxiosInstance
();
const
AXIOS_INSTANCE
=
createAxiosInstance
();
const
GET_CACHE_TTL
=
2
*
60
*
1000
;
const
MAX_GET_CACHE_SIZE
=
100
;
type
CustomClientPromise
<
T
>
=
Promise
<
T
>
&
{
cancel
?:
()
=>
void
;
};
type
CachedGetResponse
=
{
expiresAt
:
number
;
value
:
unknown
;
};
const
inFlightGetRequests
=
new
Map
<
string
,
CustomClientPromise
<
unknown
>>
();
const
cachedGetResponses
=
new
Map
<
string
,
CachedGetResponse
>
();
const
shouldSkipAuthHandling
=
(
url
?:
string
|
null
)
=>
{
const
shouldSkipAuthHandling
=
(
url
?:
string
|
null
)
=>
{
if
(
!
url
)
return
false
;
if
(
!
url
)
return
false
;
...
@@ -96,23 +110,115 @@ const convertHeaders = (headers?: HeadersInit): Record<string, string> | undefin
...
@@ -96,23 +110,115 @@ const convertHeaders = (headers?: HeadersInit): Record<string, string> | undefin
return
headers
as
Record
<
string
,
string
>
;
return
headers
as
Record
<
string
,
string
>
;
};
};
const
getRequestMethod
=
(
options
?:
RequestInit
)
=>
(
options
?.
method
||
"GET"
).
toUpperCase
();
const
shouldUseGetCache
=
(
url
:
string
,
options
?:
RequestInit
)
=>
{
const
method
=
getRequestMethod
(
options
);
const
headers
=
convertHeaders
(
options
?.
headers
);
const
hasAuthorizationHeader
=
Object
.
keys
(
headers
??
{}).
some
(
(
key
)
=>
key
.
toLowerCase
()
===
"authorization"
,
);
return
(
method
===
"GET"
&&
!
options
?.
body
&&
!
hasAuthorizationHeader
&&
!
shouldSkipAuthHandling
(
url
)
);
};
const
makeGetCacheKey
=
(
url
:
string
,
options
?:
RequestInit
)
=>
{
const
headers
=
convertHeaders
(
options
?.
headers
);
const
headerKey
=
headers
?
Object
.
entries
(
headers
)
.
sort
(([
left
],
[
right
])
=>
left
.
localeCompare
(
right
))
.
map
(([
key
,
value
])
=>
`
${
key
}
:
${
value
}
`
)
.
join
(
"|"
)
:
""
;
return
`
${
url
}
::
${
headerKey
}
`
;
};
const
clearGetCache
=
()
=>
{
inFlightGetRequests
.
clear
();
cachedGetResponses
.
clear
();
};
const
trimGetCache
=
()
=>
{
while
(
cachedGetResponses
.
size
>
MAX_GET_CACHE_SIZE
)
{
const
firstKey
=
cachedGetResponses
.
keys
().
next
().
value
;
if
(
!
firstKey
)
return
;
cachedGetResponses
.
delete
(
firstKey
);
}
};
const
withNoopCancel
=
<
T
>
(
promise
:
Promise
<
T
>
):
CustomClientPromise
<
T
>
=>
{
const
nextPromise
=
promise
as
CustomClientPromise
<
T
>
;
nextPromise
.
cancel
=
()
=>
{};
return
nextPromise
;
};
const
useCustomClient
=
<
T
>
(
url
:
string
,
options
?:
RequestInit
):
Promise
<
T
>
=>
{
const
useCustomClient
=
<
T
>
(
url
:
string
,
options
?:
RequestInit
):
Promise
<
T
>
=>
{
const
method
=
getRequestMethod
(
options
);
const
shouldCacheGet
=
shouldUseGetCache
(
url
,
options
);
const
cacheKey
=
shouldCacheGet
?
makeGetCacheKey
(
url
,
options
)
:
""
;
if
(
shouldCacheGet
)
{
const
cachedResponse
=
cachedGetResponses
.
get
(
cacheKey
);
if
(
cachedResponse
&&
cachedResponse
.
expiresAt
>
Date
.
now
())
{
return
withNoopCancel
(
Promise
.
resolve
(
cachedResponse
.
value
as
T
));
}
cachedGetResponses
.
delete
(
cacheKey
);
const
inFlightRequest
=
inFlightGetRequests
.
get
(
cacheKey
);
if
(
inFlightRequest
)
{
return
withNoopCancel
(
inFlightRequest
as
Promise
<
T
>
);
}
}
else
if
(
method
!==
"GET"
)
{
clearGetCache
();
}
const
source
=
Axios
.
CancelToken
.
source
();
const
source
=
Axios
.
CancelToken
.
source
();
const
axiosConfig
:
AxiosRequestConfig
=
{
const
axiosConfig
:
AxiosRequestConfig
=
{
url
,
url
,
method
:
options
?.
method
||
"GET"
,
method
,
headers
:
convertHeaders
(
options
?.
headers
),
headers
:
convertHeaders
(
options
?.
headers
),
data
:
options
?.
body
,
data
:
options
?.
body
,
signal
:
options
?.
signal
||
undefined
,
signal
:
options
?.
signal
||
undefined
,
cancelToken
:
source
.
token
,
cancelToken
:
source
.
token
,
};
};
const
promise
=
AXIOS_INSTANCE
(
axiosConfig
).
then
(({
data
,
status
})
=>
{
const
promise
=
AXIOS_INSTANCE
(
axiosConfig
)
return
data
instanceof
Blob
?
data
:
{
...
data
,
statusCode
:
status
};
.
then
(({
data
,
status
})
=>
{
});
const
response
=
data
instanceof
Blob
?
data
:
{
...
data
,
statusCode
:
status
};
if
(
shouldCacheGet
)
{
cachedGetResponses
.
set
(
cacheKey
,
{
expiresAt
:
Date
.
now
()
+
GET_CACHE_TTL
,
value
:
response
,
});
trimGetCache
();
}
else
if
(
method
!==
"GET"
)
{
clearGetCache
();
}
return
response
;
})
.
finally
(()
=>
{
if
(
shouldCacheGet
)
{
inFlightGetRequests
.
delete
(
cacheKey
);
}
})
as
CustomClientPromise
<
T
>
;
if
(
shouldCacheGet
)
{
inFlightGetRequests
.
set
(
cacheKey
,
promise
as
CustomClientPromise
<
unknown
>
);
}
// @ts-expect-error not exist cancel
promise
.
cancel
=
()
=>
{
promise
.
cancel
=
()
=>
{
source
.
cancel
(
"Query was cancelled"
);
source
.
cancel
(
"Query was cancelled"
);
};
};
...
...
src/api/mutator/orval-client.ts
View file @
edbc9f87
const
GET_CACHE_TTL
=
2
*
60
*
1000
;
const
MAX_GET_CACHE_SIZE
=
100
;
type
CustomClientPromise
<
T
>
=
Promise
<
T
>
&
{
cancel
?:
()
=>
void
;
};
type
CachedGetResponse
=
{
expiresAt
:
number
;
value
:
unknown
;
};
const
inFlightGetRequests
=
new
Map
<
string
,
CustomClientPromise
<
unknown
>>
();
const
cachedGetResponses
=
new
Map
<
string
,
CachedGetResponse
>
();
const
getRequestMethod
=
(
options
?:
RequestInit
)
=>
(
options
?.
method
||
"GET"
).
toUpperCase
();
const
convertHeaders
=
(
headers
?:
HeadersInit
):
Record
<
string
,
string
>
|
undefined
=>
{
if
(
!
headers
)
return
undefined
;
if
(
headers
instanceof
Headers
)
{
const
result
:
Record
<
string
,
string
>
=
{};
headers
.
forEach
((
value
,
key
)
=>
{
result
[
key
]
=
value
;
});
return
result
;
}
if
(
Array
.
isArray
(
headers
))
{
const
result
:
Record
<
string
,
string
>
=
{};
headers
.
forEach
(([
key
,
value
])
=>
{
result
[
key
]
=
value
;
});
return
result
;
}
return
headers
as
Record
<
string
,
string
>
;
};
const
shouldUseGetCache
=
(
options
?:
RequestInit
)
=>
{
const
headers
=
convertHeaders
(
options
?.
headers
);
const
hasAuthorizationHeader
=
Object
.
keys
(
headers
??
{}).
some
(
(
key
)
=>
key
.
toLowerCase
()
===
"authorization"
,
);
return
getRequestMethod
(
options
)
===
"GET"
&&
!
options
?.
body
&&
!
hasAuthorizationHeader
;
};
const
makeGetCacheKey
=
(
url
:
string
,
options
?:
RequestInit
)
=>
{
const
headers
=
convertHeaders
(
options
?.
headers
);
const
headerKey
=
headers
?
Object
.
entries
(
headers
)
.
sort
(([
left
],
[
right
])
=>
left
.
localeCompare
(
right
))
.
map
(([
key
,
value
])
=>
`
${
key
}
:
${
value
}
`
)
.
join
(
"|"
)
:
""
;
return
`
${
url
}
::
${
headerKey
}
`
;
};
const
clearGetCache
=
()
=>
{
inFlightGetRequests
.
clear
();
cachedGetResponses
.
clear
();
};
const
trimGetCache
=
()
=>
{
while
(
cachedGetResponses
.
size
>
MAX_GET_CACHE_SIZE
)
{
const
firstKey
=
cachedGetResponses
.
keys
().
next
().
value
;
if
(
!
firstKey
)
return
;
cachedGetResponses
.
delete
(
firstKey
);
}
};
const
withNoopCancel
=
<
T
>
(
promise
:
Promise
<
T
>
):
CustomClientPromise
<
T
>
=>
{
const
nextPromise
=
promise
as
CustomClientPromise
<
T
>
;
nextPromise
.
cancel
=
()
=>
{};
return
nextPromise
;
};
const
useCustomClient
=
async
<
T
>
(
url
:
string
,
options
?:
RequestInit
):
Promise
<
T
>
=>
{
const
useCustomClient
=
async
<
T
>
(
url
:
string
,
options
?:
RequestInit
):
Promise
<
T
>
=>
{
const
response
=
await
fetch
(
url
,
{
const
method
=
getRequestMethod
(
options
);
method
:
options
?.
method
||
"GET"
,
const
shouldCacheGet
=
shouldUseGetCache
(
options
);
const
cacheKey
=
shouldCacheGet
?
makeGetCacheKey
(
url
,
options
)
:
""
;
if
(
shouldCacheGet
)
{
const
cachedResponse
=
cachedGetResponses
.
get
(
cacheKey
);
if
(
cachedResponse
&&
cachedResponse
.
expiresAt
>
Date
.
now
())
{
return
withNoopCancel
(
Promise
.
resolve
(
cachedResponse
.
value
as
T
));
}
cachedGetResponses
.
delete
(
cacheKey
);
const
inFlightRequest
=
inFlightGetRequests
.
get
(
cacheKey
);
if
(
inFlightRequest
)
{
return
withNoopCancel
(
inFlightRequest
as
Promise
<
T
>
);
}
}
else
if
(
method
!==
"GET"
)
{
clearGetCache
();
}
const
promise
=
fetch
(
url
,
{
method
,
headers
:
options
?.
headers
,
headers
:
options
?.
headers
,
body
:
options
?.
body
,
body
:
options
?.
body
,
signal
:
options
?.
signal
,
signal
:
options
?.
signal
,
});
})
.
then
(
async
(
response
)
=>
{
const
data
=
await
response
.
json
();
const
result
=
{
...
data
,
statusCode
:
response
.
status
}
as
T
;
if
(
shouldCacheGet
)
{
cachedGetResponses
.
set
(
cacheKey
,
{
expiresAt
:
Date
.
now
()
+
GET_CACHE_TTL
,
value
:
result
,
});
trimGetCache
();
}
else
if
(
method
!==
"GET"
)
{
clearGetCache
();
}
return
result
;
})
.
finally
(()
=>
{
if
(
shouldCacheGet
)
{
inFlightGetRequests
.
delete
(
cacheKey
);
}
})
as
CustomClientPromise
<
T
>
;
promise
.
cancel
=
()
=>
{};
if
(
shouldCacheGet
)
{
inFlightGetRequests
.
set
(
cacheKey
,
promise
as
CustomClientPromise
<
unknown
>
);
}
const
data
=
await
response
.
json
();
return
promise
;
return
{
...
data
,
statusCode
:
response
.
status
};
};
};
export
{
useCustomClient
};
export
{
useCustomClient
};
export
type
ErrorType
<
Error
>
=
Error
;
export
type
ErrorType
<
Error
>
=
Error
;
export
type
BodyType
<
BodyData
>
=
BodyData
;
export
type
BodyType
<
BodyData
>
=
BodyData
;
\ No newline at end of file
src/app/admin/header-config/[categoryId]/posts/[postId]/page.tsx
View file @
edbc9f87
"use client"
;
"use client"
;
import
React
from
"react"
;
import
React
from
"react"
;
import
{
useParams
,
useRouter
}
from
"next/navigation"
;
import
{
useParams
,
useRouter
,
useSearchParams
}
from
"next/navigation"
;
import
{
toast
}
from
"sonner"
;
import
{
toast
}
from
"sonner"
;
import
{
AdminNewsForm
}
from
"@/components/admin/news-form"
;
import
{
AdminNewsForm
}
from
"@/components/admin/news-form"
;
import
{
fetchHeaderConfigItems
,
type
CmsHeaderCategoryItem
}
from
"@/lib/api/cms-admin"
;
import
{
fetchHeaderConfigItems
,
type
CmsHeaderCategoryItem
}
from
"@/lib/api/cms-admin"
;
...
@@ -9,8 +9,10 @@ import { fetchHeaderConfigItems, type CmsHeaderCategoryItem } from "@/lib/api/cm
...
@@ -9,8 +9,10 @@ import { fetchHeaderConfigItems, type CmsHeaderCategoryItem } from "@/lib/api/cm
export
default
function
HeaderCategoryPostFormPage
()
{
export
default
function
HeaderCategoryPostFormPage
()
{
const
params
=
useParams
();
const
params
=
useParams
();
const
router
=
useRouter
();
const
router
=
useRouter
();
const
searchParams
=
useSearchParams
();
const
categoryId
=
String
(
params
.
categoryId
??
""
);
const
categoryId
=
String
(
params
.
categoryId
??
""
);
const
postId
=
String
(
params
.
postId
??
""
);
const
postId
=
String
(
params
.
postId
??
""
);
const
returnTo
=
searchParams
.
get
(
"returnTo"
);
const
[
category
,
setCategory
]
=
React
.
useState
<
CmsHeaderCategoryItem
|
null
>
(
null
);
const
[
category
,
setCategory
]
=
React
.
useState
<
CmsHeaderCategoryItem
|
null
>
(
null
);
const
[
ready
,
setReady
]
=
React
.
useState
(
false
);
const
[
ready
,
setReady
]
=
React
.
useState
(
false
);
...
@@ -60,7 +62,7 @@ export default function HeaderCategoryPostFormPage() {
...
@@ -60,7 +62,7 @@ export default function HeaderCategoryPostFormPage() {
newsId=
{
postId
}
newsId=
{
postId
}
presetHeaderCategoryId=
{
category
.
id
}
presetHeaderCategoryId=
{
category
.
id
}
lockedType=
{
category
.
type
===
"page"
?
"baiviettrang"
:
"tintuc"
}
lockedType=
{
category
.
type
===
"page"
?
"baiviettrang"
:
"tintuc"
}
returnPath=
{
`/admin/header-config/${category.id}/posts`
}
returnPath=
{
returnTo
||
`/admin/header-config/${category.id}/posts`
}
/>
/>
);
);
}
}
src/app/admin/header-config/[categoryId]/posts/page.tsx
View file @
edbc9f87
...
@@ -3,11 +3,12 @@
...
@@ -3,11 +3,12 @@
import
React
from
"react"
;
import
React
from
"react"
;
import
dayjs
from
"dayjs"
;
import
dayjs
from
"dayjs"
;
import
Link
from
"next/link"
;
import
Link
from
"next/link"
;
import
{
useParams
,
use
Router
}
from
"next/navigation"
;
import
{
useParams
,
use
Pathname
,
useRouter
,
useSearchParams
}
from
"next/navigation"
;
import
{
toast
}
from
"sonner"
;
import
{
toast
}
from
"sonner"
;
import
{
import
{
ArrowLeft
,
ArrowLeft
,
EyeOff
,
ChevronLeft
,
ChevronRight
,
FileText
,
FileText
,
Plus
,
Plus
,
Star
,
Star
,
...
@@ -63,7 +64,7 @@ function HeaderCategoryPostsLoading() {
...
@@ -63,7 +64,7 @@ function HeaderCategoryPostsLoading() {
key=
{
`loading-${index}`
}
key=
{
`loading-${index}`
}
className=
{
index
%
2
===
0
?
"bg-white"
:
"bg-[#063e8e]/[0.03]"
}
className=
{
index
%
2
===
0
?
"bg-white"
:
"bg-[#063e8e]/[0.03]"
}
>
>
<
TableCell
colSpan=
{
7
}
className=
"px-4 py-4"
>
<
TableCell
colSpan=
{
6
}
className=
"px-4 py-4"
>
<
div
className=
"h-20 animate-pulse rounded-2xl bg-[#063e8e]/10"
/>
<
div
className=
"h-20 animate-pulse rounded-2xl bg-[#063e8e]/10"
/>
</
TableCell
>
</
TableCell
>
</
TableRow
>
</
TableRow
>
...
@@ -73,12 +74,39 @@ function HeaderCategoryPostsLoading() {
...
@@ -73,12 +74,39 @@ function HeaderCategoryPostsLoading() {
export
default
function
HeaderCategoryPostsPage
()
{
export
default
function
HeaderCategoryPostsPage
()
{
const
params
=
useParams
();
const
params
=
useParams
();
const
router
=
useRouter
();
const
router
=
useRouter
();
const
pathname
=
usePathname
();
const
searchParams
=
useSearchParams
();
const
categoryId
=
String
(
params
.
categoryId
??
""
);
const
categoryId
=
String
(
params
.
categoryId
??
""
);
const
[
items
,
setItems
]
=
React
.
useState
<
CmsNewsItem
[]
>
([]);
const
[
items
,
setItems
]
=
React
.
useState
<
CmsNewsItem
[]
>
([]);
const
[
headerItems
,
setHeaderItems
]
=
React
.
useState
<
CmsHeaderCategoryItem
[]
>
([]);
const
[
headerItems
,
setHeaderItems
]
=
React
.
useState
<
CmsHeaderCategoryItem
[]
>
([]);
const
[
search
,
setSearch
]
=
React
.
useState
(
""
);
const
[
search
,
setSearch
]
=
React
.
useState
(
()
=>
searchParams
.
get
(
"q"
)
??
""
);
const
[
ready
,
setReady
]
=
React
.
useState
(
false
);
const
[
ready
,
setReady
]
=
React
.
useState
(
false
);
const
[
deleteTarget
,
setDeleteTarget
]
=
React
.
useState
<
CmsNewsItem
|
null
>
(
null
);
const
[
deleteTarget
,
setDeleteTarget
]
=
React
.
useState
<
CmsNewsItem
|
null
>
(
null
);
const
didMountRef
=
React
.
useRef
(
false
);
const
[
page
,
setPage
]
=
React
.
useState
(()
=>
{
const
parsedPage
=
Number
(
searchParams
.
get
(
"page"
)
??
1
);
return
Number
.
isFinite
(
parsedPage
)
&&
parsedPage
>
0
?
Math
.
floor
(
parsedPage
)
:
1
;
});
const
[
pageSize
]
=
React
.
useState
(
20
);
const
listQueryString
=
React
.
useMemo
(()
=>
{
const
nextParams
=
new
URLSearchParams
();
if
(
page
>
1
)
{
nextParams
.
set
(
"page"
,
String
(
page
));
}
if
(
search
.
trim
())
{
nextParams
.
set
(
"q"
,
search
.
trim
());
}
return
nextParams
.
toString
();
},
[
page
,
search
]);
const
listPath
=
React
.
useMemo
(
()
=>
(
listQueryString
?
`
${
pathname
}
?
${
listQueryString
}
`
:
pathname
),
[
listQueryString
,
pathname
],
);
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
let
cancelled
=
false
;
let
cancelled
=
false
;
...
@@ -124,7 +152,11 @@ export default function HeaderCategoryPostsPage() {
...
@@ -124,7 +152,11 @@ export default function HeaderCategoryPostsPage() {
const
categoryPosts
=
React
.
useMemo
(()
=>
{
const
categoryPosts
=
React
.
useMemo
(()
=>
{
return
items
return
items
.
filter
((
item
)
=>
item
.
header_category_id
===
categoryId
)
.
filter
(
(
item
)
=>
item
.
header_category_id
===
categoryId
||
item
.
category_ids
.
includes
(
categoryId
),
)
.
sort
((
left
,
right
)
=>
{
.
sort
((
left
,
right
)
=>
{
const
leftFeatured
=
left
.
type
===
"tintuc"
&&
left
.
is_featured
?
1
:
0
;
const
leftFeatured
=
left
.
type
===
"tintuc"
&&
left
.
is_featured
?
1
:
0
;
const
rightFeatured
=
right
.
type
===
"tintuc"
&&
right
.
is_featured
?
1
:
0
;
const
rightFeatured
=
right
.
type
===
"tintuc"
&&
right
.
is_featured
?
1
:
0
;
...
@@ -152,6 +184,11 @@ export default function HeaderCategoryPostsPage() {
...
@@ -152,6 +184,11 @@ export default function HeaderCategoryPostsPage() {
});
});
},
[
categoryPosts
,
search
]);
},
[
categoryPosts
,
search
]);
const
totalPages
=
Math
.
ceil
(
filteredPosts
.
length
/
pageSize
);
const
paginatedPosts
=
React
.
useMemo
(()
=>
{
const
start
=
(
page
-
1
)
*
pageSize
;
return
filteredPosts
.
slice
(
start
,
start
+
pageSize
);
},
[
filteredPosts
,
page
,
pageSize
]);
const
isSinglePostCategory
=
category
?.
type
===
"page"
;
const
isSinglePostCategory
=
category
?.
type
===
"page"
;
const
createHref
=
`/admin/header-config/
${
categoryId
}
/posts/new`
;
const
createHref
=
`/admin/header-config/
${
categoryId
}
/posts/new`
;
...
@@ -162,6 +199,30 @@ export default function HeaderCategoryPostsPage() {
...
@@ -162,6 +199,30 @@ export default function HeaderCategoryPostsPage() {
}
}
},
[
canManagePosts
,
category
,
ready
,
router
]);
},
[
canManagePosts
,
category
,
ready
,
router
]);
React
.
useEffect
(()
=>
{
const
nextPath
=
listQueryString
?
`
${
pathname
}
?
${
listQueryString
}
`
:
pathname
;
const
currentPath
=
`
${
pathname
}${
searchParams
.
toString
()
?
`?
${
searchParams
.
toString
()}
`
:
""
}
`
;
if
(
nextPath
!==
currentPath
)
{
router
.
replace
(
nextPath
,
{
scroll
:
false
});
}
},
[
listQueryString
,
pathname
,
router
,
searchParams
]);
React
.
useEffect
(()
=>
{
if
(
!
didMountRef
.
current
)
{
didMountRef
.
current
=
true
;
return
;
}
setPage
((
currentPage
)
=>
(
currentPage
===
1
?
currentPage
:
1
));
},
[
search
]);
React
.
useEffect
(()
=>
{
if
(
totalPages
>
0
&&
page
>
totalPages
)
{
setPage
(
totalPages
);
}
},
[
page
,
totalPages
]);
const
stats
=
React
.
useMemo
(()
=>
{
const
stats
=
React
.
useMemo
(()
=>
{
return
[
return
[
{
{
...
@@ -195,6 +256,12 @@ export default function HeaderCategoryPostsPage() {
...
@@ -195,6 +256,12 @@ export default function HeaderCategoryPostsPage() {
}
}
};
};
const
handlePageChange
=
(
newPage
:
number
)
=>
{
if
(
newPage
>=
1
&&
newPage
<=
totalPages
)
{
setPage
(
newPage
);
}
};
if
(
!
ready
||
!
category
||
!
canManagePosts
)
{
if
(
!
ready
||
!
category
||
!
canManagePosts
)
{
return
(
return
(
<
div
className=
"rounded-2xl border border-[#063e8e]/15 bg-white p-8 text-center text-sm text-gray-700 shadow-sm"
>
<
div
className=
"rounded-2xl border border-[#063e8e]/15 bg-white p-8 text-center text-sm text-gray-700 shadow-sm"
>
...
@@ -239,16 +306,12 @@ export default function HeaderCategoryPostsPage() {
...
@@ -239,16 +306,12 @@ export default function HeaderCategoryPostsPage() {
actionIcon=
{
<
Plus
className=
"mr-2 h-4 w-4"
/>
}
actionIcon=
{
<
Plus
className=
"mr-2 h-4 w-4"
/>
}
actionDisabled=
{
isSinglePostCategory
&&
categoryPosts
.
length
>=
1
}
actionDisabled=
{
isSinglePostCategory
&&
categoryPosts
.
length
>=
1
}
onSearchChange=
{
setSearch
}
onSearchChange=
{
setSearch
}
onActionClick=
{
()
=>
router
.
push
(
createHref
)
}
onActionClick=
{
()
=>
filters=
{
router
.
push
(
`${createHref}?returnTo=${encodeURIComponent(listPath)}`
)
<
div
className=
"rounded-xl border border-[#063e8e]/15 bg-[#063e8e]/[0.03] px-4 py-2 text-sm text-gray-700"
>
<
span
className=
"font-semibold text-[#063e8e]"
>
{
categoryPosts
.
length
}
</
span
>
{
" "
}
bài viết thuộc danh mục này
</
div
>
}
}
>
>
<
div
className=
"scrollbar overflow-x-auto"
>
<
div
className=
"scrollbar overflow-x-auto"
>
<
Table
className=
"min-w-[9
8
0px] table-fixed"
>
<
Table
className=
"min-w-[9
0
0px] table-fixed"
>
<
TableHeader
>
<
TableHeader
>
<
TableRow
className=
"border-0 bg-[#063e8e] hover:bg-[#063e8e]"
>
<
TableRow
className=
"border-0 bg-[#063e8e] hover:bg-[#063e8e]"
>
<
TableHead
className=
"w-[300px] py-4 text-center text-white"
>
<
TableHead
className=
"w-[300px] py-4 text-center text-white"
>
...
@@ -266,10 +329,7 @@ export default function HeaderCategoryPostsPage() {
...
@@ -266,10 +329,7 @@ export default function HeaderCategoryPostsPage() {
<
TableHead
className=
"w-[170px] py-4 text-center text-white"
>
<
TableHead
className=
"w-[170px] py-4 text-center text-white"
>
Ngày hết hạn
Ngày hết hạn
</
TableHead
>
</
TableHead
>
<
TableHead
className=
"w-[120px] py-4 text-center text-white"
>
<
TableHead
className=
"w-[130px] py-4 text-center text-white"
>
Hiển thị
</
TableHead
>
<
TableHead
className=
"w-[100px] py-4 text-center text-white"
>
Thao tác
Thao tác
</
TableHead
>
</
TableHead
>
</
TableRow
>
</
TableRow
>
...
@@ -279,14 +339,14 @@ export default function HeaderCategoryPostsPage() {
...
@@ -279,14 +339,14 @@ export default function HeaderCategoryPostsPage() {
<
HeaderCategoryPostsLoading
/>
<
HeaderCategoryPostsLoading
/>
)
:
filteredPosts
.
length
===
0
?
(
)
:
filteredPosts
.
length
===
0
?
(
<
TableRow
>
<
TableRow
>
<
TableCell
colSpan=
{
7
}
className=
"py-12 text-center text-sm text-gray-700"
>
<
TableCell
colSpan=
{
6
}
className=
"py-12 text-center text-sm text-gray-700"
>
{
categoryPosts
.
length
===
0
{
categoryPosts
.
length
===
0
?
"Danh mục này chưa có bài viết nào."
?
"Danh mục này chưa có bài viết nào."
:
"Không có bài viết nào phù hợp."
}
:
"Không có bài viết nào phù hợp."
}
</
TableCell
>
</
TableCell
>
</
TableRow
>
</
TableRow
>
)
:
(
)
:
(
filter
edPosts
.
map
((
item
,
index
)
=>
(
paginat
edPosts
.
map
((
item
,
index
)
=>
(
<
TableRow
<
TableRow
key=
{
item
.
id
}
key=
{
item
.
id
}
className=
{
index
%
2
===
0
?
"bg-white"
:
"bg-[#063e8e]/[0.03]"
}
className=
{
index
%
2
===
0
?
"bg-white"
:
"bg-[#063e8e]/[0.03]"
}
...
@@ -337,40 +397,95 @@ export default function HeaderCategoryPostsPage() {
...
@@ -337,40 +397,95 @@ export default function HeaderCategoryPostsPage() {
</
TableCell
>
</
TableCell
>
<
TableCell
className=
"text-center"
>
<
TableCell
className=
"text-center"
>
{
item
.
is_hidden
?
(
<
AdminRowActions
<
span
className=
"inline-flex items-center rounded-full border border-gray-300 px-2.5 py-1 text-sm text-gray-700"
>
actions=
{
[
<
EyeOff
className=
"mr-1.5 h-3.5 w-3.5"
/>
{
Ẩn
kind
:
item
.
is_hidden
?
"hidden"
:
"visible"
,
</
span
>
label
:
item
.
is_hidden
)
:
(
?
"B
\
u00e0i vi
\
u1ebft
\
u0111ang
\
u1ea9n"
<
span
className=
"inline-flex items-center rounded-full border border-[#063e8e]/20 bg-[#063e8e]/10 px-2.5 py-1 text-sm text-[#063e8e]"
>
:
"B
\
u00e0i vi
\
u1ebft
\
u0111ang hi
\
u1ec3n th
\
u1ecb"
,
Hiển thị
},
</
span
>
{
)
}
kind
:
"edit"
,
label
:
"Ch
\
u1ec9nh s
\
u1eeda b
\
u00e0i vi
\
u1ebft"
,
onClick
:
()
=>
router
.
push
(
`/admin/header-config/${categoryId}/posts/${item.id}?returnTo=${encodeURIComponent(listPath)}`
,
),
},
{
kind
:
"delete"
,
label
:
"X
\
u00f3a b
\
u00e0i vi
\
u1ebft"
,
onClick
:
()
=>
setDeleteTarget
(
item
),
},
]
}
/>
</
TableCell
>
</
TableCell
>
<
TableCell
className=
"text-center"
>
<
AdminRowActions
actions=
{
[
{
kind
:
"edit"
,
label
:
"Chỉnh sửa bài viết"
,
onClick
:
()
=>
router
.
push
(
`/admin/header-config/${categoryId}/posts/${item.id}`
),
},
{
kind
:
"delete"
,
label
:
"Xóa bài viết"
,
onClick
:
()
=>
setDeleteTarget
(
item
),
},
]
}
/>
</
TableCell
>
</
TableRow
>
</
TableRow
>
))
))
)
}
)
}
</
TableBody
>
</
TableBody
>
</
Table
>
</
Table
>
</
div
>
</
div
>
{
totalPages
>
1
&&
(
<
div
className=
"flex items-center justify-between border-t border-[#063e8e]/10 px-4 py-3"
>
<
div
className=
"text-sm text-gray-700"
>
{
"Hi
\
u1ec3n th
\
u1ecb"
}
{
(
page
-
1
)
*
pageSize
+
1
}
{
"
\
u0111
\
u1ebfn"
}{
" "
}
{
Math
.
min
(
page
*
pageSize
,
filteredPosts
.
length
)
}
{
"c
\
u1ee7a"
}{
" "
}
{
filteredPosts
.
length
}
{
"b
\
u00e0i vi
\
u1ebft"
}
</
div
>
<
div
className=
"flex items-center gap-2"
>
<
Button
variant=
"outline"
size=
"icon"
className=
"h-8 w-8 border-[#063e8e]/15 bg-white text-[#063e8e] hover:bg-[#063e8e]/10"
onClick=
{
()
=>
handlePageChange
(
page
-
1
)
}
disabled=
{
page
===
1
}
>
<
ChevronLeft
className=
"h-4 w-4"
/>
</
Button
>
<
div
className=
"flex items-center gap-1"
>
{
Array
.
from
({
length
:
Math
.
min
(
totalPages
,
5
)
},
(
_
,
index
)
=>
{
let
pageNum
;
if
(
totalPages
<=
5
)
{
pageNum
=
index
+
1
;
}
else
if
(
page
<=
3
)
{
pageNum
=
index
+
1
;
}
else
if
(
page
>=
totalPages
-
2
)
{
pageNum
=
totalPages
-
4
+
index
;
}
else
{
pageNum
=
page
-
2
+
index
;
}
return
(
<
Button
key=
{
pageNum
}
variant=
{
page
===
pageNum
?
"default"
:
"outline"
}
size=
"icon"
className=
{
page
===
pageNum
?
"h-8 w-8 bg-[#063e8e] text-white hover:bg-[#063e8e]/90"
:
"h-8 w-8 border-[#063e8e]/15 bg-white text-[#063e8e] hover:bg-[#063e8e]/10"
}
onClick=
{
()
=>
handlePageChange
(
pageNum
)
}
>
{
pageNum
}
</
Button
>
);
})
}
</
div
>
<
Button
variant=
"outline"
size=
"icon"
className=
"h-8 w-8 border-[#063e8e]/15 bg-white text-[#063e8e] hover:bg-[#063e8e]/10"
onClick=
{
()
=>
handlePageChange
(
page
+
1
)
}
disabled=
{
page
===
totalPages
}
>
<
ChevronRight
className=
"h-4 w-4"
/>
</
Button
>
</
div
>
</
div
>
)
}
</
AdminTableLayout
>
</
AdminTableLayout
>
<
AdminDeleteDialog
<
AdminDeleteDialog
...
...
src/app/admin/news/[id]/page.tsx
View file @
edbc9f87
...
@@ -4,12 +4,17 @@ interface AdminNewsDetailPageProps {
...
@@ -4,12 +4,17 @@ interface AdminNewsDetailPageProps {
params
:
Promise
<
{
params
:
Promise
<
{
id
:
string
;
id
:
string
;
}
>
;
}
>
;
searchParams
:
Promise
<
{
returnTo
?:
string
;
}
>
;
}
}
export
default
async
function
AdminNewsDetailPage
({
export
default
async
function
AdminNewsDetailPage
({
params
,
params
,
searchParams
,
}:
AdminNewsDetailPageProps
)
{
}:
AdminNewsDetailPageProps
)
{
const
{
id
}
=
await
params
;
const
{
id
}
=
await
params
;
const
{
returnTo
}
=
await
searchParams
;
return
<
AdminNewsForm
newsId=
{
id
}
/>;
return
<
AdminNewsForm
newsId=
{
id
}
returnPath=
{
returnTo
||
"/admin/news"
}
/>;
}
}
src/app/admin/news/page.tsx
View file @
edbc9f87
...
@@ -5,13 +5,12 @@ import dayjs from "dayjs";
...
@@ -5,13 +5,12 @@ import dayjs from "dayjs";
import
{
import
{
Check
,
Check
,
ChevronsUpDown
,
ChevronsUpDown
,
EyeOff
,
Plus
,
Plus
,
Star
,
Star
,
Tag
,
Tag
,
}
from
"lucide-react"
;
}
from
"lucide-react"
;
import
Link
from
"next/link"
;
import
Link
from
"next/link"
;
import
{
use
Router
}
from
"next/navigation"
;
import
{
use
Pathname
,
useRouter
,
useSearchParams
}
from
"next/navigation"
;
import
{
toast
}
from
"sonner"
;
import
{
toast
}
from
"sonner"
;
import
{
AdminDeleteDialog
}
from
"@/components/admin/admin-delete-dialog"
;
import
{
AdminDeleteDialog
}
from
"@/components/admin/admin-delete-dialog"
;
import
{
AdminRowActions
}
from
"@/components/admin/admin-row-actions"
;
import
{
AdminRowActions
}
from
"@/components/admin/admin-row-actions"
;
...
@@ -46,6 +45,7 @@ import {
...
@@ -46,6 +45,7 @@ import {
import
{
import
{
deleteCmsNewsItem
,
deleteCmsNewsItem
,
fetchCmsNewsItems
,
fetchCmsNewsItems
,
fetchCmsPostCount
,
fetchHeaderConfigItems
,
fetchHeaderConfigItems
,
}
from
"@/lib/api/cms-admin"
;
}
from
"@/lib/api/cms-admin"
;
import
{
ChevronLeft
,
ChevronRight
}
from
"lucide-react"
;
import
{
ChevronLeft
,
ChevronRight
}
from
"lucide-react"
;
...
@@ -177,6 +177,22 @@ function formatDateTime(value: string) {
...
@@ -177,6 +177,22 @@ function formatDateTime(value: string) {
return
value
?
dayjs
(
value
).
format
(
"DD/MM/YYYY HH:mm"
)
:
"—"
;
return
value
?
dayjs
(
value
).
format
(
"DD/MM/YYYY HH:mm"
)
:
"—"
;
}
}
function
getDisplayCategoryNames
(
item
:
AdminNewsItem
,
categories
:
HeaderCategoryItem
[],
)
{
const
categoryIds
=
Array
.
from
(
new
Set
([
...
item
.
category_ids
,
...(
item
.
header_category_id
?
[
item
.
header_category_id
]
:
[]),
]),
);
return
categoryIds
.
map
((
categoryId
)
=>
categories
.
find
((
entry
)
=>
entry
.
id
===
categoryId
)?.
name
)
.
filter
((
name
):
name
is
string
=>
Boolean
(
name
));
}
function
useDebouncedValue
<
T
>
(
value
:
T
,
delay
=
350
)
{
function
useDebouncedValue
<
T
>
(
value
:
T
,
delay
=
350
)
{
const
[
debouncedValue
,
setDebouncedValue
]
=
React
.
useState
(
value
);
const
[
debouncedValue
,
setDebouncedValue
]
=
React
.
useState
(
value
);
...
@@ -197,7 +213,7 @@ function AdminNewsTableLoading() {
...
@@ -197,7 +213,7 @@ function AdminNewsTableLoading() {
key=
{
`loading-${index}`
}
key=
{
`loading-${index}`
}
className=
{
index
%
2
===
0
?
"bg-white"
:
"bg-[#063e8e]/[0.03]"
}
className=
{
index
%
2
===
0
?
"bg-white"
:
"bg-[#063e8e]/[0.03]"
}
>
>
<
TableCell
colSpan=
{
8
}
className=
"px-4 py-4"
>
<
TableCell
colSpan=
{
7
}
className=
"px-4 py-4"
>
<
div
className=
"h-20 animate-pulse rounded-2xl bg-[#063e8e]/10"
/>
<
div
className=
"h-20 animate-pulse rounded-2xl bg-[#063e8e]/10"
/>
</
TableCell
>
</
TableCell
>
</
TableRow
>
</
TableRow
>
...
@@ -206,20 +222,89 @@ function AdminNewsTableLoading() {
...
@@ -206,20 +222,89 @@ function AdminNewsTableLoading() {
export
default
function
AdminNewsPage
()
{
export
default
function
AdminNewsPage
()
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
pathname
=
usePathname
();
const
searchParams
=
useSearchParams
();
const
[
items
,
setItems
]
=
React
.
useState
<
AdminNewsItem
[]
>
([]);
const
[
items
,
setItems
]
=
React
.
useState
<
AdminNewsItem
[]
>
([]);
const
[
headerItems
,
setHeaderItems
]
=
React
.
useState
<
HeaderCategoryItem
[]
>
([]);
const
[
headerItems
,
setHeaderItems
]
=
React
.
useState
<
HeaderCategoryItem
[]
>
([]);
const
[
search
,
setSearch
]
=
React
.
useState
(
""
);
const
[
search
,
setSearch
]
=
React
.
useState
(()
=>
searchParams
.
get
(
"q"
)
??
""
);
const
[
typeFilter
,
setTypeFilter
]
=
React
.
useState
(
"all"
);
const
[
typeFilter
,
setTypeFilter
]
=
React
.
useState
(
const
[
categoryFilter
,
setCategoryFilter
]
=
React
.
useState
(
"all"
);
()
=>
searchParams
.
get
(
"type"
)
??
"all"
,
const
[
statusFilter
,
setStatusFilter
]
=
React
.
useState
(
"all"
);
);
const
[
categoryFilter
,
setCategoryFilter
]
=
React
.
useState
(
()
=>
searchParams
.
get
(
"category"
)
??
"all"
,
);
const
[
statusFilter
,
setStatusFilter
]
=
React
.
useState
(
()
=>
searchParams
.
get
(
"status"
)
??
"all"
,
);
const
[
deleteTarget
,
setDeleteTarget
]
=
React
.
useState
<
AdminNewsItem
|
null
>
(
null
);
const
[
deleteTarget
,
setDeleteTarget
]
=
React
.
useState
<
AdminNewsItem
|
null
>
(
null
);
const
[
ready
,
setReady
]
=
React
.
useState
(
false
);
const
[
ready
,
setReady
]
=
React
.
useState
(
false
);
const
[
isDeleting
,
setIsDeleting
]
=
React
.
useState
(
false
);
const
[
isDeleting
,
setIsDeleting
]
=
React
.
useState
(
false
);
const
[
page
,
setPage
]
=
React
.
useState
(
1
);
const
[
page
,
setPage
]
=
React
.
useState
(()
=>
{
const
parsedPage
=
Number
(
searchParams
.
get
(
"page"
)
??
1
);
return
Number
.
isFinite
(
parsedPage
)
&&
parsedPage
>
0
?
Math
.
floor
(
parsedPage
)
:
1
;
});
const
[
pageSize
]
=
React
.
useState
(
20
);
const
[
pageSize
]
=
React
.
useState
(
20
);
const
[
total
,
setTotal
]
=
React
.
useState
(
0
);
const
[
total
,
setTotal
]
=
React
.
useState
(
0
);
const
[
publishedTotal
,
setPublishedTotal
]
=
React
.
useState
(
0
);
const
[
featuredTotal
,
setFeaturedTotal
]
=
React
.
useState
(
0
);
const
didMountRef
=
React
.
useRef
(
false
);
const
debouncedSearch
=
useDebouncedValue
(
search
);
const
debouncedSearch
=
useDebouncedValue
(
search
);
const
listQueryString
=
React
.
useMemo
(()
=>
{
const
params
=
new
URLSearchParams
();
if
(
page
>
1
)
{
params
.
set
(
"page"
,
String
(
page
));
}
if
(
debouncedSearch
.
trim
())
{
params
.
set
(
"q"
,
debouncedSearch
.
trim
());
}
if
(
typeFilter
!==
"all"
)
{
params
.
set
(
"type"
,
typeFilter
);
}
if
(
categoryFilter
!==
"all"
)
{
params
.
set
(
"category"
,
categoryFilter
);
}
if
(
statusFilter
!==
"all"
)
{
params
.
set
(
"status"
,
statusFilter
);
}
return
params
.
toString
();
},
[
categoryFilter
,
debouncedSearch
,
page
,
statusFilter
,
typeFilter
]);
const
listPath
=
React
.
useMemo
(
()
=>
(
listQueryString
?
`
${
pathname
}
?
${
listQueryString
}
`
:
pathname
),
[
listQueryString
,
pathname
],
);
React
.
useEffect
(()
=>
{
void
fetchHeaderConfigItems
()
.
then
((
headerConfig
)
=>
{
setHeaderItems
(
headerConfig
.
items
);
})
.
catch
((
error
)
=>
{
toast
.
error
(
error
instanceof
Error
?
error
.
message
:
"Kh
\
u00f4ng th
\
u1ec3 t
\
u1ea3i danh m
\
u1ee5c hi
\
u1ec3n th
\
u1ecb"
,
);
});
},
[]);
const
loadStats
=
React
.
useCallback
(
async
()
=>
{
const
[
nextPublishedTotal
,
nextFeaturedTotal
]
=
await
Promise
.
all
([
fetchCmsPostCount
(
"status==published"
),
fetchCmsPostCount
(
"is_featured==true"
),
]);
setPublishedTotal
(
nextPublishedTotal
);
setFeaturedTotal
(
nextFeaturedTotal
);
},
[]);
const
apiFilters
=
React
.
useMemo
(()
=>
{
const
apiFilters
=
React
.
useMemo
(()
=>
{
const
filters
:
string
[]
=
[];
const
filters
:
string
[]
=
[];
const
keyword
=
debouncedSearch
.
trim
();
const
keyword
=
debouncedSearch
.
trim
();
...
@@ -244,23 +329,29 @@ export default function AdminNewsPage() {
...
@@ -244,23 +329,29 @@ export default function AdminNewsPage() {
const
load
=
React
.
useCallback
(
async
()
=>
{
const
load
=
React
.
useCallback
(
async
()
=>
{
setReady
(
false
);
setReady
(
false
);
const
[
newsData
,
headerConfig
]
=
await
Promise
.
all
([
const
newsData
=
await
fetchCmsNewsItems
({
fetchCmsNewsItems
({
page
,
page
,
pageSize
,
pageSize
,
sortField
:
"created_at"
,
sortField
:
"created_at"
,
sortOrder
:
"desc"
,
sortOrder
:
"desc"
,
filters
:
apiFilters
,
filters
:
apiFilters
,
});
}),
fetchHeaderConfigItems
(),
]);
setItems
(
newsData
.
items
);
setItems
(
newsData
.
items
);
setTotal
(
newsData
.
total
);
setTotal
(
newsData
.
total
);
setHeaderItems
(
headerConfig
.
items
);
setReady
(
true
);
setReady
(
true
);
},
[
apiFilters
,
page
,
pageSize
]);
},
[
apiFilters
,
page
,
pageSize
]);
React
.
useEffect
(()
=>
{
void
loadStats
().
catch
((
error
)
=>
{
toast
.
error
(
error
instanceof
Error
?
error
.
message
:
"Kh
\
u00f4ng th
\
u1ec3 t
\
u1ea3i s
\
u1ed1 li
\
u1ec7u b
\
u00e0i vi
\
u1ebft"
,
);
});
},
[
loadStats
]);
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
void
load
().
catch
((
error
)
=>
{
void
load
().
catch
((
error
)
=>
{
toast
.
error
(
toast
.
error
(
...
@@ -273,6 +364,20 @@ export default function AdminNewsPage() {
...
@@ -273,6 +364,20 @@ export default function AdminNewsPage() {
},
[
load
]);
},
[
load
]);
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
const
nextPath
=
listQueryString
?
`
${
pathname
}
?
${
listQueryString
}
`
:
pathname
;
const
currentPath
=
`
${
pathname
}${
searchParams
.
toString
()
?
`?
${
searchParams
.
toString
()}
`
:
""
}
`
;
if
(
nextPath
!==
currentPath
)
{
router
.
replace
(
nextPath
,
{
scroll
:
false
});
}
},
[
listQueryString
,
pathname
,
router
,
searchParams
]);
React
.
useEffect
(()
=>
{
if
(
!
didMountRef
.
current
)
{
didMountRef
.
current
=
true
;
return
;
}
setPage
((
currentPage
)
=>
(
currentPage
===
1
?
currentPage
:
1
));
setPage
((
currentPage
)
=>
(
currentPage
===
1
?
currentPage
:
1
));
},
[
apiFilters
,
typeFilter
]);
},
[
apiFilters
,
typeFilter
]);
...
@@ -299,16 +404,16 @@ export default function AdminNewsPage() {
...
@@ -299,16 +404,16 @@ export default function AdminNewsPage() {
},
},
{
{
label
:
"Đang hiển thị"
,
label
:
"Đang hiển thị"
,
value
:
filteredItems
.
filter
((
item
)
=>
!
item
.
is_hidden
).
length
,
value
:
publishedTotal
,
icon
:
<
Tag
className=
"h-4 w-4 text-[#063e8e]"
/>,
icon
:
<
Tag
className=
"h-4 w-4 text-[#063e8e]"
/>,
},
},
{
{
label
:
"Tin nổi bật"
,
label
:
"Tin nổi bật"
,
value
:
f
ilteredItems
.
filter
((
item
)
=>
item
.
type
===
"tintuc"
&&
item
.
is_featured
).
length
,
value
:
f
eaturedTotal
,
icon
:
<
Tag
className=
"h-4 w-4 text-[#063e8e]"
/>,
icon
:
<
Tag
className=
"h-4 w-4 text-[#063e8e]"
/>,
},
},
];
];
},
[
f
ilteredItems
,
total
]);
},
[
f
eaturedTotal
,
publishedTotal
,
total
]);
const
handleDelete
=
async
()
=>
{
const
handleDelete
=
async
()
=>
{
if
(
!
deleteTarget
||
isDeleting
)
return
;
if
(
!
deleteTarget
||
isDeleting
)
return
;
...
@@ -319,7 +424,7 @@ export default function AdminNewsPage() {
...
@@ -319,7 +424,7 @@ export default function AdminNewsPage() {
await
deleteCmsNewsItem
(
deleteTarget
.
id
);
await
deleteCmsNewsItem
(
deleteTarget
.
id
);
toast
.
success
(
"Đã xóa bài viết"
);
toast
.
success
(
"Đã xóa bài viết"
);
setDeleteTarget
(
null
);
setDeleteTarget
(
null
);
await
load
(
);
await
Promise
.
all
([
load
(),
loadStats
()]
);
}
catch
(
error
)
{
}
catch
(
error
)
{
toast
.
error
(
toast
.
error
(
error
instanceof
Error
?
error
.
message
:
"Không thể xóa bài viết"
,
error
instanceof
Error
?
error
.
message
:
"Không thể xóa bài viết"
,
...
@@ -396,7 +501,7 @@ export default function AdminNewsPage() {
...
@@ -396,7 +501,7 @@ export default function AdminNewsPage() {
}
}
>
>
<
div
className=
"scrollbar overflow-x-auto"
>
<
div
className=
"scrollbar overflow-x-auto"
>
<
Table
className=
"min-w-[1
25
0px] table-fixed"
>
<
Table
className=
"min-w-[1
12
0px] table-fixed"
>
<
TableHeader
>
<
TableHeader
>
<
TableRow
className=
"border-0 bg-[#063e8e] hover:bg-[#063e8e]"
>
<
TableRow
className=
"border-0 bg-[#063e8e] hover:bg-[#063e8e]"
>
<
TableHead
className=
"w-[260px] py-4 text-center text-white"
>
<
TableHead
className=
"w-[260px] py-4 text-center text-white"
>
...
@@ -417,10 +522,7 @@ export default function AdminNewsPage() {
...
@@ -417,10 +522,7 @@ export default function AdminNewsPage() {
<
TableHead
className=
"w-[170px] py-4 text-center text-white"
>
<
TableHead
className=
"w-[170px] py-4 text-center text-white"
>
Ngày hết hạn
Ngày hết hạn
</
TableHead
>
</
TableHead
>
<
TableHead
className=
"w-[120px] py-4 text-center text-white"
>
<
TableHead
className=
"w-[130px] py-4 text-center text-white"
>
Hiển thị
</
TableHead
>
<
TableHead
className=
"w-[100px] py-4 text-center text-white"
>
Thao tác
Thao tác
</
TableHead
>
</
TableHead
>
</
TableRow
>
</
TableRow
>
...
@@ -431,13 +533,15 @@ export default function AdminNewsPage() {
...
@@ -431,13 +533,15 @@ export default function AdminNewsPage() {
<
AdminNewsTableLoading
/>
<
AdminNewsTableLoading
/>
)
:
filteredItems
.
length
===
0
?
(
)
:
filteredItems
.
length
===
0
?
(
<
TableRow
>
<
TableRow
>
<
TableCell
colSpan=
{
8
}
className=
"py-12 text-center text-sm text-gray-700"
>
<
TableCell
colSpan=
{
7
}
className=
"py-12 text-center text-sm text-gray-700"
>
Không có bài viết nào phù hợp.
Không có bài viết nào phù hợp.
</
TableCell
>
</
TableCell
>
</
TableRow
>
</
TableRow
>
)
:
(
)
:
(
filteredItems
.
map
((
item
,
index
)
=>
{
filteredItems
.
map
((
item
,
index
)
=>
{
const
category
=
headerItems
.
find
((
entry
)
=>
entry
.
id
===
item
.
header_category_id
);
const
categoryNames
=
getDisplayCategoryNames
(
item
,
headerItems
);
const
primaryCategoryName
=
categoryNames
[
0
]
??
"
\
u2014"
;
const
extraCategoryCount
=
Math
.
max
(
categoryNames
.
length
-
1
,
0
);
return
(
return
(
<
TableRow
<
TableRow
...
@@ -482,7 +586,8 @@ export default function AdminNewsPage() {
...
@@ -482,7 +586,8 @@ export default function AdminNewsPage() {
</
TableCell
>
</
TableCell
>
<
TableCell
className=
"text-center text-sm text-gray-700"
>
<
TableCell
className=
"text-center text-sm text-gray-700"
>
{
category
?.
name
||
"—"
}
{
primaryCategoryName
}
{
extraCategoryCount
>
0
?
` (+${extraCategoryCount})`
:
""
}
</
TableCell
>
</
TableCell
>
<
TableCell
className=
"text-center text-sm text-gray-700"
>
<
TableCell
className=
"text-center text-sm text-gray-700"
>
...
@@ -492,27 +597,22 @@ export default function AdminNewsPage() {
...
@@ -492,27 +597,22 @@ export default function AdminNewsPage() {
<
TableCell
className=
"text-center text-sm text-gray-700"
>
<
TableCell
className=
"text-center text-sm text-gray-700"
>
{
formatDateTime
(
item
.
expired_at
)
}
{
formatDateTime
(
item
.
expired_at
)
}
</
TableCell
>
</
TableCell
>
<
TableCell
className=
"text-center"
>
{
item
.
is_hidden
?
(
<
span
className=
"inline-flex items-center rounded-full border border-gray-300 px-2.5 py-1 text-sm text-gray-700"
>
<
EyeOff
className=
"mr-1.5 h-3.5 w-3.5"
/>
Ẩn
</
span
>
)
:
(
<
span
className=
"inline-flex items-center rounded-full border border-[#063e8e]/20 bg-[#063e8e]/10 px-2.5 py-1 text-sm text-[#063e8e]"
>
Hiển thị
</
span
>
)
}
</
TableCell
>
<
TableCell
className=
"text-center"
>
<
TableCell
className=
"text-center"
>
<
AdminRowActions
<
AdminRowActions
actions=
{
[
actions=
{
[
{
kind
:
item
.
is_hidden
?
"hidden"
:
"visible"
,
label
:
item
.
is_hidden
?
"B
\
u00e0i vi
\
u1ebft
\
u0111ang
\
u1ea9n"
:
"B
\
u00e0i vi
\
u1ebft
\
u0111ang hi
\
u1ec3n th
\
u1ecb"
,
},
{
{
kind
:
"edit"
,
kind
:
"edit"
,
label
:
"Chỉnh sửa bài viết"
,
label
:
"Chỉnh sửa bài viết"
,
onClick
:
()
=>
router
.
push
(
`/admin/news/${item.id}`
),
onClick
:
()
=>
router
.
push
(
`/admin/news/${item.id}?returnTo=${encodeURIComponent(listPath)}`
,
),
},
},
{
{
kind
:
"delete"
,
kind
:
"delete"
,
...
...
src/components/admin/admin-row-actions.tsx
View file @
edbc9f87
...
@@ -5,6 +5,7 @@ import type { ReactNode } from "react";
...
@@ -5,6 +5,7 @@ import type { ReactNode } from "react";
import
Link
from
"next/link"
;
import
Link
from
"next/link"
;
import
{
import
{
Eye
,
Eye
,
EyeOff
,
FileText
,
FileText
,
FolderPlus
,
FolderPlus
,
PencilLine
,
PencilLine
,
...
@@ -14,7 +15,14 @@ import {
...
@@ -14,7 +15,14 @@ import {
import
{
Button
}
from
"@/components/ui/button"
;
import
{
Button
}
from
"@/components/ui/button"
;
import
{
cn
}
from
"@/lib/utils"
;
import
{
cn
}
from
"@/lib/utils"
;
type
AdminRowActionKind
=
"edit"
|
"view"
|
"delete"
|
"manage"
|
"create-child"
;
type
AdminRowActionKind
=
|
"edit"
|
"view"
|
"hidden"
|
"visible"
|
"delete"
|
"manage"
|
"create-child"
;
type
AdminRowActionBase
=
{
type
AdminRowActionBase
=
{
label
:
string
;
label
:
string
;
...
@@ -30,6 +38,14 @@ type AdminRowAction =
...
@@ -30,6 +38,14 @@ type AdminRowAction =
kind
:
"view"
;
kind
:
"view"
;
onClick
:
()
=>
void
;
onClick
:
()
=>
void
;
})
})
|
(
AdminRowActionBase
&
{
kind
:
"visible"
;
onClick
?:
()
=>
void
;
})
|
(
AdminRowActionBase
&
{
kind
:
"hidden"
;
onClick
?:
()
=>
void
;
})
|
(
AdminRowActionBase
&
{
|
(
AdminRowActionBase
&
{
kind
:
"delete"
;
kind
:
"delete"
;
onClick
:
()
=>
void
;
onClick
:
()
=>
void
;
...
@@ -65,6 +81,16 @@ const actionStyles: Record<
...
@@ -65,6 +81,16 @@ const actionStyles: Record<
"border-emerald-100 bg-white text-emerald-600 hover:border-emerald-200 hover:bg-emerald-50 hover:text-emerald-700"
,
"border-emerald-100 bg-white text-emerald-600 hover:border-emerald-200 hover:bg-emerald-50 hover:text-emerald-700"
,
icon
:
<
Eye
className=
"h-4 w-4"
/>,
icon
:
<
Eye
className=
"h-4 w-4"
/>,
},
},
visible
:
{
button
:
"border-emerald-100 bg-white text-emerald-600 hover:border-emerald-200 hover:bg-emerald-50 hover:text-emerald-700"
,
icon
:
<
Eye
className=
"h-4 w-4"
/>,
},
hidden
:
{
button
:
"border-red-100 bg-white text-red-600 hover:border-red-200 hover:bg-red-50 hover:text-red-700"
,
icon
:
<
EyeOff
className=
"h-4 w-4"
/>,
},
delete
:
{
delete
:
{
button
:
button
:
"border-red-100 bg-white text-red-600 hover:border-red-200 hover:bg-red-50 hover:text-red-700"
,
"border-red-100 bg-white text-red-600 hover:border-red-200 hover:bg-red-50 hover:text-red-700"
,
...
...
src/components/admin/news-form.tsx
View file @
edbc9f87
...
@@ -79,6 +79,8 @@ const selectContentClassName = "border-[#063e8e]/15 bg-white text-gray-700";
...
@@ -79,6 +79,8 @@ const selectContentClassName = "border-[#063e8e]/15 bg-white text-gray-700";
const
selectItemClassName
=
const
selectItemClassName
=
"text-gray-700 focus:bg-[#063e8e]/10 focus:text-[#063e8e]"
;
"text-gray-700 focus:bg-[#063e8e]/10 focus:text-[#063e8e]"
;
const
SEARCH_TAG_VISIBLE_LIMIT
=
20
;
function
flattenHeaderTree
(
function
flattenHeaderTree
(
items
:
HeaderCategoryTreeItem
[],
items
:
HeaderCategoryTreeItem
[],
depth
=
0
,
depth
=
0
,
...
@@ -99,9 +101,9 @@ function isCategoryCompatible(
...
@@ -99,9 +101,9 @@ function isCategoryCompatible(
postType
:
AdminNewsType
|
""
,
postType
:
AdminNewsType
|
""
,
)
{
)
{
if
(
!
postType
)
return
true
;
if
(
!
postType
)
return
true
;
if
(
headerType
===
"news"
)
return
postType
!==
"baiviettrang
"
;
if
(
postType
===
"tintuc"
)
return
headerType
===
"news
"
;
if
(
headerType
===
"page"
)
return
postType
===
"baiviettrang
"
;
if
(
postType
===
"baiviettrang"
)
return
headerType
===
"page
"
;
return
tru
e
;
return
fals
e
;
}
}
function
toImageRef
(
item
:
AdminMediaItem
):
AdminNewsImageRef
{
function
toImageRef
(
item
:
AdminMediaItem
):
AdminNewsImageRef
{
...
@@ -259,6 +261,124 @@ function HeaderCategoryCombobox({
...
@@ -259,6 +261,124 @@ function HeaderCategoryCombobox({
);
);
}
}
function
HeaderCategoryMultiPicker
({
values
,
options
,
disabled
,
onChange
,
}:
{
values
:
string
[];
options
:
Array
<
{
id
:
string
;
name
:
string
;
type
:
HeaderCategoryItem
[
"type"
];
depth
:
number
;
}
>
;
disabled
?:
boolean
;
onChange
:
(
values
:
string
[])
=>
void
;
})
{
const
[
search
,
setSearch
]
=
React
.
useState
(
""
);
const
selectedIds
=
React
.
useMemo
(()
=>
new
Set
(
values
),
[
values
]);
const
selectedOptions
=
React
.
useMemo
(
()
=>
options
.
filter
((
option
)
=>
selectedIds
.
has
(
option
.
id
)),
[
options
,
selectedIds
],
);
const
filteredOptions
=
React
.
useMemo
(()
=>
{
const
keyword
=
search
.
trim
().
toLowerCase
();
const
availableOptions
=
options
.
filter
((
option
)
=>
!
selectedIds
.
has
(
option
.
id
));
const
matchedOptions
=
keyword
?
availableOptions
.
filter
((
option
)
=>
option
.
name
.
toLowerCase
().
includes
(
keyword
),
)
:
availableOptions
;
return
[...
selectedOptions
,
...
matchedOptions
.
slice
(
0
,
20
)];
},
[
options
,
search
,
selectedIds
,
selectedOptions
]);
const
toggleValue
=
(
id
:
string
,
checked
:
boolean
)
=>
{
onChange
(
checked
?
[...
values
,
id
]
:
values
.
filter
((
item
)
=>
item
!==
id
));
};
return
(
<
div
className=
"space-y-2"
>
<
div
className=
"mb-3 flex flex-col gap-3 md:flex-row md:items-end md:justify-between"
>
<
div
className=
"min-w-0 flex-1"
>
<
Label
className=
"mb-1.5 block text-gray-700"
>
Danh mục hiển thị
<
span
className=
"text-red-600"
>
*
</
span
>
</
Label
>
<
Input
value=
{
search
}
onChange=
{
(
event
)
=>
setSearch
(
event
.
target
.
value
)
}
placeholder=
"Tìm danh mục theo tên"
disabled=
{
disabled
}
className=
{
fieldClassName
}
/>
</
div
>
<
div
className=
"rounded-lg border border-[#063e8e]/10 bg-white px-3 py-2 text-sm text-gray-700"
>
Đã chọn
{
values
.
length
}
danh mục
</
div
>
</
div
>
<
div
className=
"max-h-64 overflow-y-auto rounded-xl border border-[#063e8e]/10 bg-white p-2"
>
{
filteredOptions
.
length
>
0
?
(
<
div
className=
"grid grid-cols-1 gap-2 md:grid-cols-2"
>
{
filteredOptions
.
map
((
option
)
=>
(
<
label
key=
{
option
.
id
}
className=
"flex items-center gap-3 rounded-lg border border-[#063e8e]/10 bg-white px-3 py-2"
>
<
Checkbox
checked=
{
selectedIds
.
has
(
option
.
id
)
}
disabled=
{
disabled
}
onCheckedChange=
{
(
checked
)
=>
toggleValue
(
option
.
id
,
checked
===
true
)
}
className=
"border-[#063e8e]/30 data-[state=checked]:border-[#063e8e] data-[state=checked]:bg-[#063e8e]"
/>
<
span
className=
"min-w-0 truncate text-sm text-gray-700"
>
{
formatHeaderCategoryOptionLabel
(
option
)
}
</
span
>
</
label
>
))
}
</
div
>
)
:
(
<
p
className=
"px-3 py-2 text-sm text-gray-700"
>
{
"Kh
\
u00f4ng t
\
u00ecm th
\
u1ea5y danh m
\
u1ee5c ph
\
u00f9 h
\
u1ee3p."
}
</
p
>
)
}
</
div
>
</
div
>
);
}
function
HeaderCategorySinglePicker
({
value
,
options
,
disabled
,
onChange
,
}:
{
value
:
string
;
options
:
Array
<
{
id
:
string
;
name
:
string
;
type
:
HeaderCategoryItem
[
"type"
];
depth
:
number
;
}
>
;
disabled
?:
boolean
;
onChange
:
(
value
:
string
)
=>
void
;
})
{
return
(
<
div
className=
"space-y-2"
>
<
Label
className=
"mb-1.5 block text-gray-700"
>
Danh mục hiển thị
<
span
className=
"text-red-600"
>
*
</
span
>
</
Label
>
<
HeaderCategoryCombobox
value=
{
value
}
onChange=
{
onChange
}
disabled=
{
disabled
}
options=
{
options
}
/>
</
div
>
);
}
export
function
AdminNewsForm
({
export
function
AdminNewsForm
({
newsId
,
newsId
,
presetHeaderCategoryId
,
presetHeaderCategoryId
,
...
@@ -275,6 +395,7 @@ export function AdminNewsForm({
...
@@ -275,6 +395,7 @@ export function AdminNewsForm({
const
[
allTags
,
setAllTags
]
=
React
.
useState
<
CmsTagItem
[]
>
([]);
const
[
allTags
,
setAllTags
]
=
React
.
useState
<
CmsTagItem
[]
>
([]);
const
[
form
,
setForm
]
=
React
.
useState
<
AdminNewsFormValues
|
null
>
(
null
);
const
[
form
,
setForm
]
=
React
.
useState
<
AdminNewsFormValues
|
null
>
(
null
);
const
[
pickerOpen
,
setPickerOpen
]
=
React
.
useState
(
false
);
const
[
pickerOpen
,
setPickerOpen
]
=
React
.
useState
(
false
);
const
[
tagSearch
,
setTagSearch
]
=
React
.
useState
(
""
);
const
[
isSubmitting
,
setIsSubmitting
]
=
React
.
useState
(
false
);
const
[
isSubmitting
,
setIsSubmitting
]
=
React
.
useState
(
false
);
const
[
isLoadingInitialData
,
setIsLoadingInitialData
]
=
React
.
useState
(
true
);
const
[
isLoadingInitialData
,
setIsLoadingInitialData
]
=
React
.
useState
(
true
);
const
[
isMissingPost
,
setIsMissingPost
]
=
React
.
useState
(
false
);
const
[
isMissingPost
,
setIsMissingPost
]
=
React
.
useState
(
false
);
...
@@ -309,7 +430,7 @@ export function AdminNewsForm({
...
@@ -309,7 +430,7 @@ export function AdminNewsForm({
...
cloneAdminNewsFormValues
(),
...
cloneAdminNewsFormValues
(),
type
:
lockedType
??
(
presetHeader
?.
type
===
"page"
?
"baiviettrang"
:
"tintuc"
),
type
:
lockedType
??
(
presetHeader
?.
type
===
"page"
?
"baiviettrang"
:
"tintuc"
),
header_category_id
:
presetHeaderCategoryId
??
""
,
header_category_id
:
presetHeaderCategoryId
??
""
,
category_ids
:
presetHeader
?.
category_ids
??
[],
category_ids
:
presetHeader
CategoryId
?
[
presetHeaderCategoryId
]
:
[],
created_at
:
now
,
created_at
:
now
,
updated_at
:
now
,
updated_at
:
now
,
});
});
...
@@ -328,10 +449,12 @@ export function AdminNewsForm({
...
@@ -328,10 +449,12 @@ export function AdminNewsForm({
return
;
return
;
}
}
if
(
const
belongsToPresetHeaderCategory
=
presetHeaderCategoryId
&&
!
presetHeaderCategoryId
||
currentItem
.
header_category_id
!==
presetHeaderCategoryId
currentItem
.
header_category_id
===
presetHeaderCategoryId
||
)
{
currentItem
.
category_ids
.
includes
(
presetHeaderCategoryId
);
if
(
!
belongsToPresetHeaderCategory
)
{
setIsMissingPost
(
true
);
setIsMissingPost
(
true
);
setForm
(
null
);
setForm
(
null
);
return
;
return
;
...
@@ -344,7 +467,16 @@ export function AdminNewsForm({
...
@@ -344,7 +467,16 @@ export function AdminNewsForm({
}
}
setIsMissingPost
(
false
);
setIsMissingPost
(
false
);
setForm
(
cloneAdminNewsFormValues
(
currentItem
));
const
nextForm
=
cloneAdminNewsFormValues
(
currentItem
);
if
(
presetHeaderCategoryId
&&
currentItem
.
type
===
"tintuc"
&&
!
nextForm
.
category_ids
.
includes
(
presetHeaderCategoryId
)
)
{
nextForm
.
category_ids
=
[
presetHeaderCategoryId
,
...
nextForm
.
category_ids
];
nextForm
.
header_category_id
=
nextForm
.
category_ids
[
0
]
??
""
;
}
setForm
(
nextForm
);
}
catch
(
error
)
{
}
catch
(
error
)
{
if
(
cancelled
)
return
;
if
(
cancelled
)
return
;
toast
.
error
(
error
instanceof
Error
?
error
.
message
:
"Không thể tải bài viết"
);
toast
.
error
(
error
instanceof
Error
?
error
.
message
:
"Không thể tải bài viết"
);
...
@@ -365,9 +497,7 @@ export function AdminNewsForm({
...
@@ -365,9 +497,7 @@ export function AdminNewsForm({
},
[
isCreate
,
lockedType
,
newsId
,
presetHeaderCategoryId
]);
},
[
isCreate
,
lockedType
,
newsId
,
presetHeaderCategoryId
]);
const
headerOptions
=
React
.
useMemo
(()
=>
{
const
headerOptions
=
React
.
useMemo
(()
=>
{
return
flattenHeaderTree
(
buildHeaderCategoryTree
(
headerItems
)).
filter
(
return
flattenHeaderTree
(
buildHeaderCategoryTree
(
headerItems
));
(
item
)
=>
item
.
type
===
"news"
||
item
.
type
===
"page"
,
);
},
[
headerItems
]);
},
[
headerItems
]);
const
selectedHeaderCategory
=
React
.
useMemo
(()
=>
{
const
selectedHeaderCategory
=
React
.
useMemo
(()
=>
{
...
@@ -375,12 +505,12 @@ export function AdminNewsForm({
...
@@ -375,12 +505,12 @@ export function AdminNewsForm({
},
[
form
?.
header_category_id
,
headerItems
]);
},
[
form
?.
header_category_id
,
headerItems
]);
const
availableSearchTags
=
React
.
useMemo
(()
=>
{
const
availableSearchTags
=
React
.
useMemo
(()
=>
{
if
(
!
selectedHeaderCategory
||
selectedHeaderCategory
.
type
!==
"news
"
)
return
[];
if
(
form
?.
type
!==
"tintuc
"
)
return
[];
return
allTags
.
map
((
item
)
=>
item
.
name
);
return
allTags
.
map
((
item
)
=>
item
.
name
);
},
[
allTags
,
selectedHeaderCategory
]);
},
[
allTags
,
form
?.
type
]);
const
selectedTagIds
=
React
.
useMemo
(()
=>
{
const
selectedTagIds
=
React
.
useMemo
(()
=>
{
if
(
!
selectedHeaderCategory
||
selectedHeaderCategory
.
type
!==
"news
"
)
return
[];
if
(
form
?.
type
!==
"tintuc
"
)
return
[];
const
tagMap
=
new
Map
(
const
tagMap
=
new
Map
(
allTags
.
map
((
item
)
=>
[
item
.
name
.
trim
().
toLowerCase
(),
item
.
id
]
as
const
),
allTags
.
map
((
item
)
=>
[
item
.
name
.
trim
().
toLowerCase
(),
item
.
id
]
as
const
),
...
@@ -389,7 +519,38 @@ export function AdminNewsForm({
...
@@ -389,7 +519,38 @@ export function AdminNewsForm({
return
form
?.
tagsearch_values
return
form
?.
tagsearch_values
.
map
((
name
)
=>
tagMap
.
get
(
name
.
trim
().
toLowerCase
()))
.
map
((
name
)
=>
tagMap
.
get
(
name
.
trim
().
toLowerCase
()))
.
filter
((
value
):
value
is
string
=>
Boolean
(
value
))
??
[];
.
filter
((
value
):
value
is
string
=>
Boolean
(
value
))
??
[];
},
[
allTags
,
form
?.
tagsearch_values
,
selectedHeaderCategory
]);
},
[
allTags
,
form
?.
tagsearch_values
,
form
?.
type
]);
const
visibleSearchTags
=
React
.
useMemo
(()
=>
{
if
(
form
?.
type
!==
"tintuc"
)
return
[];
const
normalizedKeyword
=
tagSearch
.
trim
().
toLowerCase
();
const
selectedNames
=
new
Set
(
form
.
tagsearch_values
);
const
selectedTags
=
availableSearchTags
.
filter
((
item
)
=>
selectedNames
.
has
(
item
));
const
availableTags
=
availableSearchTags
.
filter
((
item
)
=>
!
selectedNames
.
has
(
item
));
const
matchedTags
=
normalizedKeyword
?
availableTags
.
filter
((
item
)
=>
item
.
toLowerCase
().
includes
(
normalizedKeyword
))
:
availableTags
;
return
[
...
selectedTags
,
...
matchedTags
.
slice
(
0
,
Math
.
max
(
SEARCH_TAG_VISIBLE_LIMIT
-
selectedTags
.
length
,
0
),
),
];
},
[
availableSearchTags
,
form
?.
tagsearch_values
,
form
?.
type
,
tagSearch
]);
const
matchedSearchTagTotal
=
React
.
useMemo
(()
=>
{
if
(
form
?.
type
!==
"tintuc"
)
return
0
;
const
normalizedKeyword
=
tagSearch
.
trim
().
toLowerCase
();
if
(
!
normalizedKeyword
)
return
availableSearchTags
.
length
;
return
availableSearchTags
.
filter
((
item
)
=>
item
.
toLowerCase
().
includes
(
normalizedKeyword
),
).
length
;
},
[
availableSearchTags
,
form
?.
type
,
tagSearch
]);
const
articlePageAlreadyUsed
=
React
.
useMemo
(()
=>
{
const
articlePageAlreadyUsed
=
React
.
useMemo
(()
=>
{
if
(
!
form
?.
header_category_id
||
form
.
type
!==
"baiviettrang"
)
return
false
;
if
(
!
form
?.
header_category_id
||
form
.
type
!==
"baiviettrang"
)
return
false
;
...
@@ -439,13 +600,24 @@ export function AdminNewsForm({
...
@@ -439,13 +600,24 @@ export function AdminNewsForm({
return
{
return
{
...
current
,
...
current
,
type
:
nextType
,
type
:
nextType
,
header_category_id
:
compatibleHeader
?
current
.
header_category_id
:
""
,
header_category_id
:
nextType
===
"baiviettrang"
?
compatibleHeader
?
current
.
header_category_id
:
""
:
current
.
category_ids
.
find
((
id
)
=>
headerOptions
.
some
(
(
option
)
=>
option
.
id
===
id
&&
isCategoryCompatible
(
option
.
type
,
nextType
),
),
)
??
""
,
category_ids
:
category_ids
:
nextType
===
"baiviettrang"
nextType
===
"baiviettrang"
?
[]
?
[]
:
compatibleHeader
:
current
.
category_ids
.
filter
((
id
)
=>
?
current
.
category_ids
headerOptions
.
some
(
:
[],
(
option
)
=>
option
.
id
===
id
&&
isCategoryCompatible
(
option
.
type
,
nextType
),
),
),
tagsearch_values
:
nextType
===
"baiviettrang"
?
[]
:
current
.
tagsearch_values
,
tagsearch_values
:
nextType
===
"baiviettrang"
?
[]
:
current
.
tagsearch_values
,
is_featured
:
nextType
===
"tintuc"
?
current
.
is_featured
:
false
,
is_featured
:
nextType
===
"tintuc"
?
current
.
is_featured
:
false
,
};
};
...
@@ -454,16 +626,16 @@ export function AdminNewsForm({
...
@@ -454,16 +626,16 @@ export function AdminNewsForm({
const handleHeaderCategoryChange = (value: string) =
>
{
const handleHeaderCategoryChange = (value: string) =
>
{
const
nextCategory
=
headerItems
.
find
((
item
)
=>
item
.
id
===
value
)
??
null
;
const
nextCategory
=
headerItems
.
find
((
item
)
=>
item
.
id
===
value
)
??
null
;
const
nextSearchTags
=
nextCategory
?.
type
===
"news"
?
allTags
.
map
((
item
)
=>
item
.
name
)
:
[];
setForm
((
current
)
=>
{
setForm
((
current
)
=>
{
if
(
!
current
)
return
current
;
if
(
!
current
)
return
current
;
const
nextSearchTags
=
current
.
type
===
"tintuc"
?
allTags
.
map
((
item
)
=>
item
.
name
)
:
[];
return
{
return
{
...
current
,
...
current
,
header_category_id
:
value
,
header_category_id
:
value
,
category_ids
:
nextCategory
?.
category_ids
??
[],
category_ids
:
nextCategory
?.
id
?
[
nextCategory
.
id
]
:
[],
tagsearch_values
:
current
.
tagsearch_values
.
filter
((
item
)
=>
tagsearch_values
:
current
.
tagsearch_values
.
filter
((
item
)
=>
nextSearchTags
.
includes
(
item
),
nextSearchTags
.
includes
(
item
),
),
),
...
@@ -471,6 +643,18 @@ export function AdminNewsForm({
...
@@ -471,6 +643,18 @@ export function AdminNewsForm({
});
});
}
;
}
;
const handleHeaderCategoriesChange = (values: string[]) =
>
{
setForm
((
current
)
=>
{
if
(
!
current
)
return
current
;
return
{
...
current
,
header_category_id
:
values
[
0
]
??
""
,
category_ids
:
values
,
};
});
}
;
const handleToggleSearchTag = (value: string, checked: boolean) =
>
{
const handleToggleSearchTag = (value: string, checked: boolean) =
>
{
setForm
((
current
)
=>
{
setForm
((
current
)
=>
{
if
(
!
current
)
return
current
;
if
(
!
current
)
return
current
;
...
@@ -507,7 +691,12 @@ export function AdminNewsForm({
...
@@ -507,7 +691,12 @@ export function AdminNewsForm({
return
;
return
;
}
}
if
(
!
form
.
header_category_id
)
{
if
(
form
.
type
===
"baiviettrang"
&&
!
form
.
header_category_id
)
{
toast
.
error
(
"Vui lòng chọn danh mục hiển thị"
);
return
;
}
if
(
form
.
type
===
"tintuc"
&&
form
.
category_ids
.
length
===
0
)
{
toast
.
error
(
"Vui lòng chọn danh mục hiển thị"
);
toast
.
error
(
"Vui lòng chọn danh mục hiển thị"
);
return
;
return
;
}
}
...
@@ -522,13 +711,13 @@ export function AdminNewsForm({
...
@@ -522,13 +711,13 @@ export function AdminNewsForm({
slug
:
slugifyAdminNews
(
form
.
slug
.
trim
()),
slug
:
slugifyAdminNews
(
form
.
slug
.
trim
()),
summary
:
form
.
summary
,
summary
:
form
.
summary
,
type
:
form
.
type
,
type
:
form
.
type
,
header_category_id
:
form
.
header_category_id
,
header_category_id
:
form
.
type
===
"tintuc"
?
form
.
category_ids
[
0
]
??
""
:
form
.
header_category_id
,
category_ids
:
category_ids
:
form
.
type
===
"baiviettrang"
form
.
type
===
"baiviettrang"
?
form
.
header_category_id
?
form
.
header_category_id
?
[
form
.
header_category_id
]
?
[
form
.
header_category_id
]
:
[]
:
[]
:
selectedHeaderCategory
?.
category_ids
??
[]
,
:
form
.
category_ids
,
tag_ids
:
form
.
type
===
"baiviettrang"
?
[]
:
selectedTagIds
,
tag_ids
:
form
.
type
===
"baiviettrang"
?
[]
:
selectedTagIds
,
is_featured
:
form
.
type
===
"tintuc"
?
form
.
is_featured
:
false
,
is_featured
:
form
.
type
===
"tintuc"
?
form
.
is_featured
:
false
,
thumbnail_id
:
form
.
thumbnail
&&
isUuid
(
form
.
thumbnail
.
id
)
?
form
.
thumbnail
.
id
:
null
,
thumbnail_id
:
form
.
thumbnail
&&
isUuid
(
form
.
thumbnail
.
id
)
?
form
.
thumbnail
.
id
:
null
,
...
@@ -741,20 +930,6 @@ export function AdminNewsForm({
...
@@ -741,20 +930,6 @@ export function AdminNewsForm({
</
SelectContent
>
</
SelectContent
>
</
Select
>
</
Select
>
</
div
>
</
div
>
<
div
>
<
Label
className=
"mb-1.5 block text-gray-700"
>
Danh mục hiển thị
</
Label
>
<
HeaderCategoryCombobox
value=
{
form
.
header_category_id
}
onChange=
{
handleHeaderCategoryChange
}
disabled=
{
isHeaderCategoryLocked
}
options=
{
headerOptions
.
filter
((
option
)
=>
isCategoryCompatible
(
option
.
type
,
form
.
type
),
)
}
/>
</
div
>
</
div
>
</
div
>
<
div
className=
"grid grid-cols-1 gap-4 md:grid-cols-2"
>
<
div
className=
"grid grid-cols-1 gap-4 md:grid-cols-2"
>
...
@@ -820,26 +995,85 @@ export function AdminNewsForm({
...
@@ -820,26 +995,85 @@ export function AdminNewsForm({
</
div
>
</
div
>
</
div
>
</
div
>
{
availableSearchTags
.
length
>
0
?
(
<
div
className=
"rounded-xl border border-[#063e8e]/15 bg-[#063e8e]/[0.02] p-4 xl:col-span-2"
>
{
form
.
type
===
"tintuc"
?
(
<
HeaderCategoryMultiPicker
values=
{
form
.
category_ids
}
onChange=
{
handleHeaderCategoriesChange
}
disabled=
{
isHeaderCategoryLocked
}
options=
{
headerOptions
.
filter
((
option
)
=>
isCategoryCompatible
(
option
.
type
,
form
.
type
),
)
}
/>
)
:
(
<
HeaderCategorySinglePicker
value=
{
form
.
header_category_id
}
onChange=
{
handleHeaderCategoryChange
}
disabled=
{
isHeaderCategoryLocked
}
options=
{
headerOptions
.
filter
((
option
)
=>
isCategoryCompatible
(
option
.
type
,
form
.
type
),
)
}
/>
)
}
</
div
>
{
form
.
type
===
"tintuc"
?
(
<
div
className=
"rounded-xl border border-[#063e8e]/15 bg-[#063e8e]/[0.02] p-4 xl:col-span-2"
>
<
div
className=
"rounded-xl border border-[#063e8e]/15 bg-[#063e8e]/[0.02] p-4 xl:col-span-2"
>
<
Label
className=
"mb-3 block text-gray-700"
>
Tag tìm kiếm
</
Label
>
<
div
className=
"mb-3 flex flex-col gap-3 md:flex-row md:items-end md:justify-between"
>
<
div
className=
"grid grid-cols-1 gap-2 md:grid-cols-2"
>
<
div
className=
"min-w-0 flex-1"
>
{
availableSearchTags
.
map
((
item
)
=>
(
<
Label
className=
"mb-1.5 block text-gray-700"
>
Tag tìm kiếm
</
Label
>
<
label
<
Input
key=
{
item
}
value=
{
tagSearch
}
className=
"flex items-center gap-3 rounded-lg border border-[#063e8e]/10 bg-white px-3 py-2"
onChange=
{
(
event
)
=>
setTagSearch
(
event
.
target
.
value
)
}
>
placeholder=
"Tìm tag theo tên"
<
Checkbox
className=
{
fieldClassName
}
checked=
{
form
.
tagsearch_values
.
includes
(
item
)
}
/>
onCheckedChange=
{
(
checked
)
=>
</
div
>
handleToggleSearchTag
(
item
,
checked
===
true
)
<
div
className=
"rounded-lg border border-[#063e8e]/10 bg-white px-3 py-2 text-sm text-gray-700"
>
}
Đã chọn
{
form
.
tagsearch_values
.
length
}
tag
className=
"border-[#063e8e]/30 data-[state=checked]:border-[#063e8e] data-[state=checked]:bg-[#063e8e]"
</
div
>
/>
<
span
className=
"text-sm text-gray-700"
>
{
item
}
</
span
>
</
label
>
))
}
</
div
>
</
div
>
{
availableSearchTags
.
length
>
0
?
(
<>
{
visibleSearchTags
.
length
>
0
?
(
<
div
className=
"max-h-64 overflow-y-auto rounded-xl border border-[#063e8e]/10 bg-white p-2"
>
<
div
className=
"grid grid-cols-1 gap-2 md:grid-cols-2"
>
{
visibleSearchTags
.
map
((
item
)
=>
(
<
label
key=
{
item
}
className=
"flex items-center gap-3 rounded-lg border border-[#063e8e]/10 bg-white px-3 py-2"
>
<
Checkbox
checked=
{
form
.
tagsearch_values
.
includes
(
item
)
}
onCheckedChange=
{
(
checked
)
=>
handleToggleSearchTag
(
item
,
checked
===
true
)
}
className=
"border-[#063e8e]/30 data-[state=checked]:border-[#063e8e] data-[state=checked]:bg-[#063e8e]"
/>
<
span
className=
"min-w-0 truncate text-sm text-gray-700"
>
{
item
}
</
span
>
</
label
>
))
}
</
div
>
</
div
>
)
:
(
<
p
className=
"rounded-lg border border-dashed border-[#063e8e]/20 bg-white px-3 py-2 text-sm text-gray-700"
>
Không tìm thấy tag phù hợp.
</
p
>
)
}
{
matchedSearchTagTotal
>
visibleSearchTags
.
length
?
(
<
p
className=
"mt-2 text-sm text-gray-700"
>
Đang hiển thị
{
visibleSearchTags
.
length
}
trong
{
" "
}
{
matchedSearchTagTotal
}
tag phù hợp. Nhập thêm từ khóa để lọc nhanh hơn.
</
p
>
)
:
null
}
</>
)
:
(
<
p
className=
"rounded-lg border border-dashed border-[#063e8e]/20 bg-white px-3 py-2 text-sm text-gray-700"
>
{
"Ch
\
u01b0a c
\
u00f3 tag t
\
u00ecm ki
\
u1ebfm n
\
u00e0o. Vui l
\
u00f2ng t
\
u1ea1o tag trong m
\
u1ee5c qu
\
u1ea3n l
\
u00fd tag tr
\
u01b0
\
u1edbc khi g
\
u00e1n cho b
\
u00e0i vi
\
u1ebft."
}
</
p
>
)
}
</
div
>
</
div
>
)
:
null
}
)
:
null
}
</
div
>
</
div
>
...
...
src/lib/api/cms-admin.ts
View file @
edbc9f87
...
@@ -319,9 +319,9 @@ const parseLegacyPostContent = (content?: string | null): CmsPostContentSection[
...
@@ -319,9 +319,9 @@ const parseLegacyPostContent = (content?: string | null): CmsPostContentSection[
const
transformPost
=
(
const
transformPost
=
(
post
:
CmsRawPostItem
,
post
:
CmsRawPostItem
,
tagMap
:
Map
<
string
,
CmsTagItem
[]
>
,
tagMap
?
:
Map
<
string
,
CmsTagItem
[]
>
,
):
CmsNewsItem
=>
{
):
CmsNewsItem
=>
{
const
tagItems
=
tagMap
.
get
(
post
.
id
??
""
)
??
[];
const
tagItems
=
tagMap
?
.
get
(
post
.
id
??
""
)
??
[];
const
categories
=
Array
.
isArray
(
post
.
categories
)
?
post
.
categories
:
[];
const
categories
=
Array
.
isArray
(
post
.
categories
)
?
post
.
categories
:
[];
const
primaryCategory
=
categories
[
0
]
??
null
;
const
primaryCategory
=
categories
[
0
]
??
null
;
const
primaryCategoryType
=
primaryCategory
?.
type
??
null
;
const
primaryCategoryType
=
primaryCategory
?.
type
??
null
;
...
@@ -387,14 +387,6 @@ async function fetchTagsForPost(postId: string) {
...
@@ -387,14 +387,6 @@ async function fetchTagsForPost(postId: string) {
});
});
}
}
async
function
fetchTagMapForPosts
(
postIds
:
string
[])
{
const
entries
=
await
Promise
.
all
(
postIds
.
map
(
async
(
postId
)
=>
[
postId
,
await
fetchTagsForPost
(
postId
)]
as
const
),
);
return
new
Map
(
entries
);
}
function
buildHeaderItemsFromTree
(
function
buildHeaderItemsFromTree
(
node
:
CmsPageConfigNode
,
node
:
CmsPageConfigNode
,
rootId
:
string
,
rootId
:
string
,
...
@@ -760,16 +752,32 @@ export async function fetchCmsNewsItems(params?: {
...
@@ -760,16 +752,32 @@ export async function fetchCmsNewsItems(params?: {
);
);
const
rows
=
result
.
rows
??
[];
const
rows
=
result
.
rows
??
[];
const
tagMap
=
await
fetchTagMapForPosts
(
rows
.
map
((
item
)
=>
item
.
id
??
""
).
filter
(
Boolean
));
return
{
return
{
items
:
rows
.
map
((
item
)
=>
transformPost
(
item
,
tagMap
)),
items
:
rows
.
map
((
item
)
=>
transformPost
(
item
)),
total
:
result
.
count
??
0
,
total
:
result
.
count
??
0
,
page
:
result
.
page
??
1
,
page
:
result
.
page
??
1
,
pageSize
:
result
.
pageSize
??
20
,
pageSize
:
result
.
pageSize
??
20
,
};
};
}
}
export
async
function
fetchCmsPostCount
(
filters
?:
string
)
{
const
queryParams
=
new
URLSearchParams
();
if
(
filters
?.
trim
())
{
queryParams
.
set
(
"filters"
,
filters
.
trim
());
}
queryParams
.
set
(
"page"
,
"1"
);
queryParams
.
set
(
"pageSize"
,
"1"
);
const
result
=
await
cmsRequest
<
CmsPagedResult
<
CmsRawPostItem
>>
(
`/post?
${
queryParams
.
toString
()}
`
,
);
return
result
.
count
??
0
;
}
export
async
function
fetchCmsNewsItem
(
id
:
string
)
{
export
async
function
fetchCmsNewsItem
(
id
:
string
)
{
const
post
=
await
cmsRequest
<
CmsRawPostItem
>
(
`/post/
${
id
}
`
);
const
post
=
await
cmsRequest
<
CmsRawPostItem
>
(
`/post/
${
id
}
`
);
const
tags
=
post
.
id
?
await
fetchTagsForPost
(
post
.
id
)
:
[];
const
tags
=
post
.
id
?
await
fetchTagsForPost
(
post
.
id
)
:
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment