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
8c9baba4
Commit
8c9baba4
authored
May 20, 2026
by
Lê Bảo Hồng Đức
☄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix siteInformation
parent
67165167
Changes
53
Show whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
3048 additions
and
48 deletions
+3048
-48
orval.config.ts
orval.config.ts
+2
-0
logo.ts
src/api/endpoints/logo.ts
+792
-0
site-information.ts
src/api/endpoints/site-information.ts
+1126
-0
banner.ts
src/api/models/banner.ts
+20
-0
bannerMutate.ts
src/api/models/bannerMutate.ts
+15
-0
deleteLogoId200.ts
src/api/models/deleteLogoId200.ts
+11
-0
deleteLogoId200AllOf.ts
src/api/models/deleteLogoId200AllOf.ts
+11
-0
getApiV10NewsletterSubscriptionParams.ts
src/api/models/getApiV10NewsletterSubscriptionParams.ts
+37
-0
getApiV10SiteInformation200.ts
src/api/models/getApiV10SiteInformation200.ts
+11
-0
getApiV10SiteInformation200AllOf.ts
src/api/models/getApiV10SiteInformation200AllOf.ts
+12
-0
getApiV10SiteInformationParams.ts
src/api/models/getApiV10SiteInformationParams.ts
+37
-0
getApiV10VideoId200.ts
src/api/models/getApiV10VideoId200.ts
+11
-0
getApiV10VideoId200AllOf.ts
src/api/models/getApiV10VideoId200AllOf.ts
+12
-0
getApiV10VideoParams.ts
src/api/models/getApiV10VideoParams.ts
+37
-0
getLogoId200.ts
src/api/models/getLogoId200.ts
+11
-0
getLogoId200AllOf.ts
src/api/models/getLogoId200AllOf.ts
+12
-0
getLogoParams.ts
src/api/models/getLogoParams.ts
+37
-0
getSiteInformation200.ts
src/api/models/getSiteInformation200.ts
+11
-0
getSiteInformation200AllOf.ts
src/api/models/getSiteInformation200AllOf.ts
+12
-0
getSiteInformationParams.ts
src/api/models/getSiteInformationParams.ts
+37
-0
index.ts
src/api/models/index.ts
+39
-0
logo.ts
src/api/models/logo.ts
+2
-3
logoCreate.ts
src/api/models/logoCreate.ts
+1
-1
logoUpdate.ts
src/api/models/logoUpdate.ts
+1
-1
patchApiV10NewsletterSubscriptionId200.ts
src/api/models/patchApiV10NewsletterSubscriptionId200.ts
+11
-0
patchApiV10NewsletterSubscriptionId200AllOf.ts
...api/models/patchApiV10NewsletterSubscriptionId200AllOf.ts
+12
-0
patchApiV10VideoId200.ts
src/api/models/patchApiV10VideoId200.ts
+11
-0
patchApiV10VideoId200AllOf.ts
src/api/models/patchApiV10VideoId200AllOf.ts
+12
-0
postApiV10NewsletterSubscription200.ts
src/api/models/postApiV10NewsletterSubscription200.ts
+11
-0
postApiV10NewsletterSubscription200AllOf.ts
src/api/models/postApiV10NewsletterSubscription200AllOf.ts
+12
-0
postApiV10Video200.ts
src/api/models/postApiV10Video200.ts
+11
-0
postApiV10Video200AllOf.ts
src/api/models/postApiV10Video200AllOf.ts
+12
-0
postLogo200.ts
src/api/models/postLogo200.ts
+11
-0
postLogo200AllOf.ts
src/api/models/postLogo200AllOf.ts
+12
-0
putApiV10SiteInformation200.ts
src/api/models/putApiV10SiteInformation200.ts
+11
-0
putApiV10SiteInformation200AllOf.ts
src/api/models/putApiV10SiteInformation200AllOf.ts
+12
-0
putLogoId200.ts
src/api/models/putLogoId200.ts
+11
-0
putLogoId200AllOf.ts
src/api/models/putLogoId200AllOf.ts
+12
-0
putSiteInformation200.ts
src/api/models/putSiteInformation200.ts
+11
-0
putSiteInformation200AllOf.ts
src/api/models/putSiteInformation200AllOf.ts
+12
-0
sequelizemeta.ts
src/api/models/sequelizemeta.ts
+11
-0
sequelizemetaMutate.ts
src/api/models/sequelizemetaMutate.ts
+11
-0
siteInformationBranch.ts
src/api/models/siteInformationBranch.ts
+33
-0
siteInformationBranchMutate.ts
src/api/models/siteInformationBranchMutate.ts
+24
-0
siteInformationData.ts
src/api/models/siteInformationData.ts
+12
-2
siteInformationDataLogo.ts
src/api/models/siteInformationDataLogo.ts
+13
-0
siteInformationResponse.ts
src/api/models/siteInformationResponse.ts
+2
-2
siteInformationResponseAllOf.ts
src/api/models/siteInformationResponseAllOf.ts
+2
-2
siteInformationSocialLink.ts
src/api/models/siteInformationSocialLink.ts
+10
-4
siteInformationSocialMutate.ts
src/api/models/siteInformationSocialMutate.ts
+14
-0
siteInformationUpdateBody.ts
src/api/models/siteInformationUpdateBody.ts
+6
-2
page.tsx
src/app/admin/base-config/page.tsx
+403
-30
base-config.ts
src/mockdata/base-config.ts
+26
-1
No files found.
orval.config.ts
View file @
8c9baba4
...
...
@@ -125,6 +125,8 @@ const orvalConfig = async () => {
'NewsPageConfig'
,
'Video'
,
'NewsletterSubscription'
,
'SiteInformation'
,
'Logo'
,
],
},
},
...
...
src/api/endpoints/logo.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
{
useInfiniteQuery
,
useMutation
,
useQuery
}
from
'@tanstack/react-query'
;
import
type
{
DataTag
,
DefinedInitialDataOptions
,
DefinedUseInfiniteQueryResult
,
DefinedUseQueryResult
,
InfiniteData
,
MutationFunction
,
QueryClient
,
QueryFunction
,
QueryKey
,
UndefinedInitialDataOptions
,
UseInfiniteQueryOptions
,
UseInfiniteQueryResult
,
UseMutationOptions
,
UseMutationResult
,
UseQueryOptions
,
UseQueryResult
}
from
'@tanstack/react-query'
;
import
type
{
DeleteLogoId200
,
GetLogoId200
,
GetLogoParams
,
LogoCreate
,
LogoUpdate
,
PostLogo200
,
PutLogoId200
,
ResponseGetAllData
}
from
'../models'
;
import
{
useCustomClient
}
from
'../mutator/custom-client'
;
import
type
{
ErrorType
,
BodyType
}
from
'../mutator/custom-client'
;
type
SecondParameter
<
T
extends
(...
args
:
never
)
=>
unknown
>
=
Parameters
<
T
>
[
1
];
/**
* Retrieve a single logo record by its ID
* @summary Get logo by ID
*/
export
type
getLogoIdResponse200
=
{
data
:
GetLogoId200
status
:
200
}
export
type
getLogoIdResponse404
=
{
data
:
void
status
:
404
}
export
type
getLogoIdResponseSuccess
=
(
getLogoIdResponse200
)
&
{
headers
:
Headers
;
};
export
type
getLogoIdResponseError
=
(
getLogoIdResponse404
)
&
{
headers
:
Headers
;
};
export
type
getLogoIdResponse
=
(
getLogoIdResponseSuccess
|
getLogoIdResponseError
)
export
const
getGetLogoIdUrl
=
(
id
:
string
,)
=>
{
return
`/logo/
${
id
}
`
}
export
const
getLogoId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
getLogoIdResponse
>
=>
{
return
useCustomClient
<
getLogoIdResponse
>
(
getGetLogoIdUrl
(
id
),
{
...
options
,
method
:
'GET'
}
);}
export
const
getGetLogoIdInfiniteQueryKey
=
(
id
?:
string
,)
=>
{
return
[
'infinite'
,
`/logo/
${
id
}
`
]
as
const
;
}
export
const
getGetLogoIdQueryKey
=
(
id
?:
string
,)
=>
{
return
[
`/logo/
${
id
}
`
]
as
const
;
}
export
const
getGetLogoIdInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>>
,
TError
=
ErrorType
<
void
>>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
)
=>
{
const
{
query
:
queryOptions
,
request
:
requestOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetLogoIdInfiniteQueryKey
(
id
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>>
=
({
signal
})
=>
getLogoId
(
id
,
{
signal
,
...
requestOptions
});
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
export
type
GetLogoIdInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>>
export
type
GetLogoIdInfiniteQueryError
=
ErrorType
<
void
>
export
function
useGetLogoIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>>
,
TError
=
ErrorType
<
void
>>
(
id
:
string
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getLogoId
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetLogoIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>>
,
TError
=
ErrorType
<
void
>>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getLogoId
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetLogoIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>>
,
TError
=
ErrorType
<
void
>>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
* @summary Get logo by ID
*/
export
function
useGetLogoIdInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>>
,
TError
=
ErrorType
<
void
>>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetLogoIdInfiniteQueryOptions
(
id
,
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
query
.
queryKey
=
queryOptions
.
queryKey
;
return
query
;
}
/**
* @summary Get logo by ID
*/
export
const
prefetchGetLogoIdInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
=
ErrorType
<
void
>>
(
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetLogoIdInfiniteQueryOptions
(
id
,
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
return
queryClient
;
}
export
const
getGetLogoIdQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
=
ErrorType
<
void
>>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
)
=>
{
const
{
query
:
queryOptions
,
request
:
requestOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetLogoIdQueryKey
(
id
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>>
=
({
signal
})
=>
getLogoId
(
id
,
{
signal
,
...
requestOptions
});
return
{
queryKey
,
queryFn
,
enabled
:
!!
(
id
),
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
export
type
GetLogoIdQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>>
export
type
GetLogoIdQueryError
=
ErrorType
<
void
>
export
function
useGetLogoId
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
=
ErrorType
<
void
>>
(
id
:
string
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getLogoId
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetLogoId
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
=
ErrorType
<
void
>>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getLogoId
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetLogoId
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
=
ErrorType
<
void
>>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
* @summary Get logo by ID
*/
export
function
useGetLogoId
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
=
ErrorType
<
void
>>
(
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetLogoIdQueryOptions
(
id
,
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
query
.
queryKey
=
queryOptions
.
queryKey
;
return
query
;
}
/**
* @summary Get logo by ID
*/
export
const
prefetchGetLogoIdQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
=
ErrorType
<
void
>>
(
queryClient
:
QueryClient
,
id
:
string
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogoId
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetLogoIdQueryOptions
(
id
,
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
return
queryClient
;
}
/**
* Update a single logo record by its ID
* @summary Update logo by ID
*/
export
type
putLogoIdResponse200
=
{
data
:
PutLogoId200
status
:
200
}
export
type
putLogoIdResponse400
=
{
data
:
void
status
:
400
}
export
type
putLogoIdResponse404
=
{
data
:
void
status
:
404
}
export
type
putLogoIdResponse409
=
{
data
:
void
status
:
409
}
export
type
putLogoIdResponseSuccess
=
(
putLogoIdResponse200
)
&
{
headers
:
Headers
;
};
export
type
putLogoIdResponseError
=
(
putLogoIdResponse400
|
putLogoIdResponse404
|
putLogoIdResponse409
)
&
{
headers
:
Headers
;
};
export
type
putLogoIdResponse
=
(
putLogoIdResponseSuccess
|
putLogoIdResponseError
)
export
const
getPutLogoIdUrl
=
(
id
:
string
,)
=>
{
return
`/logo/
${
id
}
`
}
export
const
putLogoId
=
async
(
id
:
string
,
logoUpdate
:
LogoUpdate
,
options
?:
RequestInit
):
Promise
<
putLogoIdResponse
>
=>
{
return
useCustomClient
<
putLogoIdResponse
>
(
getPutLogoIdUrl
(
id
),
{
...
options
,
method
:
'PUT'
,
headers
:
{
'Content-Type'
:
'application/json'
,
...
options
?.
headers
},
body
:
JSON
.
stringify
(
logoUpdate
,)
}
);}
export
const
getPutLogoIdMutationOptions
=
<
TError
=
ErrorType
<
void
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putLogoId
>>
,
TError
,{
id
:
string
;
data
:
BodyType
<
LogoUpdate
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putLogoId
>>
,
TError
,{
id
:
string
;
data
:
BodyType
<
LogoUpdate
>
},
TContext
>
=>
{
const
mutationKey
=
[
'putLogoId'
];
const
{
mutation
:
mutationOptions
,
request
:
requestOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
:
{...
options
,
mutation
:
{...
options
.
mutation
,
mutationKey
}}
:
{
mutation
:
{
mutationKey
,
},
request
:
undefined
};
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
putLogoId
>>
,
{
id
:
string
;
data
:
BodyType
<
LogoUpdate
>
}
>
=
(
props
)
=>
{
const
{
id
,
data
}
=
props
??
{};
return
putLogoId
(
id
,
data
,
requestOptions
)
}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
PutLogoIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
putLogoId
>>>
export
type
PutLogoIdMutationBody
=
BodyType
<
LogoUpdate
>
export
type
PutLogoIdMutationError
=
ErrorType
<
void
>
/**
* @summary Update logo by ID
*/
export
const
usePutLogoId
=
<
TError
=
ErrorType
<
void
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putLogoId
>>
,
TError
,{
id
:
string
;
data
:
BodyType
<
LogoUpdate
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
putLogoId
>>
,
TError
,
{
id
:
string
;
data
:
BodyType
<
LogoUpdate
>
},
TContext
>
=>
{
const
mutationOptions
=
getPutLogoIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
/**
* Delete a single logo record by its ID
* @summary Delete logo by ID
*/
export
type
deleteLogoIdResponse200
=
{
data
:
DeleteLogoId200
status
:
200
}
export
type
deleteLogoIdResponse404
=
{
data
:
void
status
:
404
}
export
type
deleteLogoIdResponse409
=
{
data
:
void
status
:
409
}
export
type
deleteLogoIdResponseSuccess
=
(
deleteLogoIdResponse200
)
&
{
headers
:
Headers
;
};
export
type
deleteLogoIdResponseError
=
(
deleteLogoIdResponse404
|
deleteLogoIdResponse409
)
&
{
headers
:
Headers
;
};
export
type
deleteLogoIdResponse
=
(
deleteLogoIdResponseSuccess
|
deleteLogoIdResponseError
)
export
const
getDeleteLogoIdUrl
=
(
id
:
string
,)
=>
{
return
`/logo/
${
id
}
`
}
export
const
deleteLogoId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
deleteLogoIdResponse
>
=>
{
return
useCustomClient
<
deleteLogoIdResponse
>
(
getDeleteLogoIdUrl
(
id
),
{
...
options
,
method
:
'DELETE'
}
);}
export
const
getDeleteLogoIdMutationOptions
=
<
TError
=
ErrorType
<
void
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteLogoId
>>
,
TError
,{
id
:
string
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteLogoId
>>
,
TError
,{
id
:
string
},
TContext
>
=>
{
const
mutationKey
=
[
'deleteLogoId'
];
const
{
mutation
:
mutationOptions
,
request
:
requestOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
:
{...
options
,
mutation
:
{...
options
.
mutation
,
mutationKey
}}
:
{
mutation
:
{
mutationKey
,
},
request
:
undefined
};
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
deleteLogoId
>>
,
{
id
:
string
}
>
=
(
props
)
=>
{
const
{
id
}
=
props
??
{};
return
deleteLogoId
(
id
,
requestOptions
)
}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
DeleteLogoIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
deleteLogoId
>>>
export
type
DeleteLogoIdMutationError
=
ErrorType
<
void
>
/**
* @summary Delete logo by ID
*/
export
const
useDeleteLogoId
=
<
TError
=
ErrorType
<
void
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteLogoId
>>
,
TError
,{
id
:
string
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
deleteLogoId
>>
,
TError
,
{
id
:
string
},
TContext
>
=>
{
const
mutationOptions
=
getDeleteLogoIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
/**
* Retrieve a list of logos with pagination, filtering and sorting
* @summary Get all logos
*/
export
type
getLogoResponse200
=
{
data
:
ResponseGetAllData
status
:
200
}
export
type
getLogoResponseSuccess
=
(
getLogoResponse200
)
&
{
headers
:
Headers
;
};
;
export
type
getLogoResponse
=
(
getLogoResponseSuccess
)
export
const
getGetLogoUrl
=
(
params
?:
GetLogoParams
,)
=>
{
const
normalizedParams
=
new
URLSearchParams
();
Object
.
entries
(
params
||
{}).
forEach
(([
key
,
value
])
=>
{
if
(
value
!==
undefined
)
{
normalizedParams
.
append
(
key
,
value
===
null
?
'null'
:
value
.
toString
())
}
});
const
stringifiedParams
=
normalizedParams
.
toString
();
return
stringifiedParams
.
length
>
0
?
`/logo?
${
stringifiedParams
}
`
:
`/logo`
}
export
const
getLogo
=
async
(
params
?:
GetLogoParams
,
options
?:
RequestInit
):
Promise
<
getLogoResponse
>
=>
{
return
useCustomClient
<
getLogoResponse
>
(
getGetLogoUrl
(
params
),
{
...
options
,
method
:
'GET'
}
);}
export
const
getGetLogoInfiniteQueryKey
=
(
params
?:
GetLogoParams
,)
=>
{
return
[
'infinite'
,
`/logo`
,
...(
params
?
[
params
]:
[])
]
as
const
;
}
export
const
getGetLogoQueryKey
=
(
params
?:
GetLogoParams
,)
=>
{
return
[
`/logo`
,
...(
params
?
[
params
]:
[])
]
as
const
;
}
export
const
getGetLogoInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getLogo
>>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetLogoParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
)
=>
{
const
{
query
:
queryOptions
,
request
:
requestOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetLogoInfiniteQueryKey
(
params
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
getLogo
>>>
=
({
signal
})
=>
getLogo
(
params
,
{
signal
,
...
requestOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
export
type
GetLogoInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getLogo
>>>
export
type
GetLogoInfiniteQueryError
=
ErrorType
<
unknown
>
export
function
useGetLogoInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getLogo
>>>
,
TError
=
ErrorType
<
unknown
>>
(
params
:
undefined
|
GetLogoParams
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getLogo
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetLogoInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getLogo
>>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetLogoParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getLogo
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetLogoInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getLogo
>>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetLogoParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
* @summary Get all logos
*/
export
function
useGetLogoInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getLogo
>>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetLogoParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetLogoInfiniteQueryOptions
(
params
,
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
query
.
queryKey
=
queryOptions
.
queryKey
;
return
query
;
}
/**
* @summary Get all logos
*/
export
const
prefetchGetLogoInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
=
ErrorType
<
unknown
>>
(
queryClient
:
QueryClient
,
params
?:
GetLogoParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetLogoInfiniteQueryOptions
(
params
,
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
return
queryClient
;
}
export
const
getGetLogoQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetLogoParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
)
=>
{
const
{
query
:
queryOptions
,
request
:
requestOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetLogoQueryKey
(
params
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
getLogo
>>>
=
({
signal
})
=>
getLogo
(
params
,
{
signal
,
...
requestOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
export
type
GetLogoQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getLogo
>>>
export
type
GetLogoQueryError
=
ErrorType
<
unknown
>
export
function
useGetLogo
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
=
ErrorType
<
unknown
>>
(
params
:
undefined
|
GetLogoParams
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getLogo
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetLogo
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetLogoParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getLogo
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetLogo
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetLogoParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
* @summary Get all logos
*/
export
function
useGetLogo
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetLogoParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetLogoQueryOptions
(
params
,
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
query
.
queryKey
=
queryOptions
.
queryKey
;
return
query
;
}
/**
* @summary Get all logos
*/
export
const
prefetchGetLogoQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
=
ErrorType
<
unknown
>>
(
queryClient
:
QueryClient
,
params
?:
GetLogoParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getLogo
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetLogoQueryOptions
(
params
,
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
return
queryClient
;
}
/**
* Create a new logo record
* @summary Create a logo
*/
export
type
postLogoResponse200
=
{
data
:
PostLogo200
status
:
200
}
export
type
postLogoResponse400
=
{
data
:
void
status
:
400
}
export
type
postLogoResponse404
=
{
data
:
void
status
:
404
}
export
type
postLogoResponse409
=
{
data
:
void
status
:
409
}
export
type
postLogoResponseSuccess
=
(
postLogoResponse200
)
&
{
headers
:
Headers
;
};
export
type
postLogoResponseError
=
(
postLogoResponse400
|
postLogoResponse404
|
postLogoResponse409
)
&
{
headers
:
Headers
;
};
export
type
postLogoResponse
=
(
postLogoResponseSuccess
|
postLogoResponseError
)
export
const
getPostLogoUrl
=
()
=>
{
return
`/logo`
}
export
const
postLogo
=
async
(
logoCreate
:
LogoCreate
,
options
?:
RequestInit
):
Promise
<
postLogoResponse
>
=>
{
return
useCustomClient
<
postLogoResponse
>
(
getPostLogoUrl
(),
{
...
options
,
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
,
...
options
?.
headers
},
body
:
JSON
.
stringify
(
logoCreate
,)
}
);}
export
const
getPostLogoMutationOptions
=
<
TError
=
ErrorType
<
void
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postLogo
>>
,
TError
,{
data
:
BodyType
<
LogoCreate
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postLogo
>>
,
TError
,{
data
:
BodyType
<
LogoCreate
>
},
TContext
>
=>
{
const
mutationKey
=
[
'postLogo'
];
const
{
mutation
:
mutationOptions
,
request
:
requestOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
:
{...
options
,
mutation
:
{...
options
.
mutation
,
mutationKey
}}
:
{
mutation
:
{
mutationKey
,
},
request
:
undefined
};
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
postLogo
>>
,
{
data
:
BodyType
<
LogoCreate
>
}
>
=
(
props
)
=>
{
const
{
data
}
=
props
??
{};
return
postLogo
(
data
,
requestOptions
)
}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
PostLogoMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
postLogo
>>>
export
type
PostLogoMutationBody
=
BodyType
<
LogoCreate
>
export
type
PostLogoMutationError
=
ErrorType
<
void
>
/**
* @summary Create a logo
*/
export
const
usePostLogo
=
<
TError
=
ErrorType
<
void
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postLogo
>>
,
TError
,{
data
:
BodyType
<
LogoCreate
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
postLogo
>>
,
TError
,
{
data
:
BodyType
<
LogoCreate
>
},
TContext
>
=>
{
const
mutationOptions
=
getPostLogoMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
\ No newline at end of file
src/api/endpoints/site-information.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
{
useInfiniteQuery
,
useMutation
,
useQuery
}
from
'@tanstack/react-query'
;
import
type
{
DataTag
,
DefinedInitialDataOptions
,
DefinedUseInfiniteQueryResult
,
DefinedUseQueryResult
,
InfiniteData
,
MutationFunction
,
QueryClient
,
QueryFunction
,
QueryKey
,
UndefinedInitialDataOptions
,
UseInfiniteQueryOptions
,
UseInfiniteQueryResult
,
UseMutationOptions
,
UseMutationResult
,
UseQueryOptions
,
UseQueryResult
}
from
'@tanstack/react-query'
;
import
type
{
GetSiteInformation200
,
GetSiteInformationParams
,
PutSiteInformation200
,
SiteInformationBranchMutate
,
SiteInformationSocialMutate
,
SiteInformationUpdateBody
}
from
'../models'
;
import
{
useCustomClient
}
from
'../mutator/custom-client'
;
import
type
{
ErrorType
,
BodyType
}
from
'../mutator/custom-client'
;
type
SecondParameter
<
T
extends
(...
args
:
never
)
=>
unknown
>
=
Parameters
<
T
>
[
1
];
/**
* Retrieve current public site information configuration.
* @summary Get current site information
*/
export
type
getSiteInformationResponse200
=
{
data
:
GetSiteInformation200
status
:
200
}
export
type
getSiteInformationResponseSuccess
=
(
getSiteInformationResponse200
)
&
{
headers
:
Headers
;
};
;
export
type
getSiteInformationResponse
=
(
getSiteInformationResponseSuccess
)
export
const
getGetSiteInformationUrl
=
(
params
?:
GetSiteInformationParams
,)
=>
{
const
normalizedParams
=
new
URLSearchParams
();
Object
.
entries
(
params
||
{}).
forEach
(([
key
,
value
])
=>
{
if
(
value
!==
undefined
)
{
normalizedParams
.
append
(
key
,
value
===
null
?
'null'
:
value
.
toString
())
}
});
const
stringifiedParams
=
normalizedParams
.
toString
();
return
stringifiedParams
.
length
>
0
?
`/siteInformation?
${
stringifiedParams
}
`
:
`/siteInformation`
}
export
const
getSiteInformation
=
async
(
params
?:
GetSiteInformationParams
,
options
?:
RequestInit
):
Promise
<
getSiteInformationResponse
>
=>
{
return
useCustomClient
<
getSiteInformationResponse
>
(
getGetSiteInformationUrl
(
params
),
{
...
options
,
method
:
'GET'
}
);}
export
const
getGetSiteInformationInfiniteQueryKey
=
(
params
?:
GetSiteInformationParams
,)
=>
{
return
[
'infinite'
,
`/siteInformation`
,
...(
params
?
[
params
]:
[])
]
as
const
;
}
export
const
getGetSiteInformationQueryKey
=
(
params
?:
GetSiteInformationParams
,)
=>
{
return
[
`/siteInformation`
,
...(
params
?
[
params
]:
[])
]
as
const
;
}
export
const
getGetSiteInformationInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetSiteInformationParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
)
=>
{
const
{
query
:
queryOptions
,
request
:
requestOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetSiteInformationInfiniteQueryKey
(
params
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>>
=
({
signal
})
=>
getSiteInformation
(
params
,
{
signal
,
...
requestOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
export
type
GetSiteInformationInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>>
export
type
GetSiteInformationInfiniteQueryError
=
ErrorType
<
unknown
>
export
function
useGetSiteInformationInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>>
,
TError
=
ErrorType
<
unknown
>>
(
params
:
undefined
|
GetSiteInformationParams
,
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformationInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetSiteInformationParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformationInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetSiteInformationParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
* @summary Get current site information
*/
export
function
useGetSiteInformationInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetSiteInformationParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetSiteInformationInfiniteQueryOptions
(
params
,
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
query
.
queryKey
=
queryOptions
.
queryKey
;
return
query
;
}
/**
* @summary Get current site information
*/
export
const
prefetchGetSiteInformationInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
=
ErrorType
<
unknown
>>
(
queryClient
:
QueryClient
,
params
?:
GetSiteInformationParams
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetSiteInformationInfiniteQueryOptions
(
params
,
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
return
queryClient
;
}
export
const
getGetSiteInformationQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetSiteInformationParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
)
=>
{
const
{
query
:
queryOptions
,
request
:
requestOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetSiteInformationQueryKey
(
params
);
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>>
=
({
signal
})
=>
getSiteInformation
(
params
,
{
signal
,
...
requestOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
export
type
GetSiteInformationQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>>
export
type
GetSiteInformationQueryError
=
ErrorType
<
unknown
>
export
function
useGetSiteInformation
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
=
ErrorType
<
unknown
>>
(
params
:
undefined
|
GetSiteInformationParams
,
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformation
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetSiteInformationParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformation
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetSiteInformationParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
* @summary Get current site information
*/
export
function
useGetSiteInformation
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
=
ErrorType
<
unknown
>>
(
params
?:
GetSiteInformationParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetSiteInformationQueryOptions
(
params
,
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
query
.
queryKey
=
queryOptions
.
queryKey
;
return
query
;
}
/**
* @summary Get current site information
*/
export
const
prefetchGetSiteInformationQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
=
ErrorType
<
unknown
>>
(
queryClient
:
QueryClient
,
params
?:
GetSiteInformationParams
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformation
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetSiteInformationQueryOptions
(
params
,
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
return
queryClient
;
}
/**
* Update current site information configuration
* @summary Update current site information
*/
export
type
putSiteInformationResponse200
=
{
data
:
PutSiteInformation200
status
:
200
}
export
type
putSiteInformationResponse400
=
{
data
:
void
status
:
400
}
export
type
putSiteInformationResponse401
=
{
data
:
void
status
:
401
}
export
type
putSiteInformationResponseSuccess
=
(
putSiteInformationResponse200
)
&
{
headers
:
Headers
;
};
export
type
putSiteInformationResponseError
=
(
putSiteInformationResponse400
|
putSiteInformationResponse401
)
&
{
headers
:
Headers
;
};
export
type
putSiteInformationResponse
=
(
putSiteInformationResponseSuccess
|
putSiteInformationResponseError
)
export
const
getPutSiteInformationUrl
=
()
=>
{
return
`/siteInformation`
}
export
const
putSiteInformation
=
async
(
siteInformationUpdateBody
:
SiteInformationUpdateBody
,
options
?:
RequestInit
):
Promise
<
putSiteInformationResponse
>
=>
{
return
useCustomClient
<
putSiteInformationResponse
>
(
getPutSiteInformationUrl
(),
{
...
options
,
method
:
'PUT'
,
headers
:
{
'Content-Type'
:
'application/json'
,
...
options
?.
headers
},
body
:
JSON
.
stringify
(
siteInformationUpdateBody
,)
}
);}
export
const
getPutSiteInformationMutationOptions
=
<
TError
=
ErrorType
<
void
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putSiteInformation
>>
,
TError
,{
data
:
BodyType
<
SiteInformationUpdateBody
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putSiteInformation
>>
,
TError
,{
data
:
BodyType
<
SiteInformationUpdateBody
>
},
TContext
>
=>
{
const
mutationKey
=
[
'putSiteInformation'
];
const
{
mutation
:
mutationOptions
,
request
:
requestOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
:
{...
options
,
mutation
:
{...
options
.
mutation
,
mutationKey
}}
:
{
mutation
:
{
mutationKey
,
},
request
:
undefined
};
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
putSiteInformation
>>
,
{
data
:
BodyType
<
SiteInformationUpdateBody
>
}
>
=
(
props
)
=>
{
const
{
data
}
=
props
??
{};
return
putSiteInformation
(
data
,
requestOptions
)
}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
PutSiteInformationMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
putSiteInformation
>>>
export
type
PutSiteInformationMutationBody
=
BodyType
<
SiteInformationUpdateBody
>
export
type
PutSiteInformationMutationError
=
ErrorType
<
void
>
/**
* @summary Update current site information
*/
export
const
usePutSiteInformation
=
<
TError
=
ErrorType
<
void
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
putSiteInformation
>>
,
TError
,{
data
:
BodyType
<
SiteInformationUpdateBody
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
putSiteInformation
>>
,
TError
,
{
data
:
BodyType
<
SiteInformationUpdateBody
>
},
TContext
>
=>
{
const
mutationOptions
=
getPutSiteInformationMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
/**
* @summary Update fixed site social link
*/
export
type
patchSiteInformationSocialsIdResponse200
=
{
data
:
void
status
:
200
}
export
type
patchSiteInformationSocialsIdResponseSuccess
=
(
patchSiteInformationSocialsIdResponse200
)
&
{
headers
:
Headers
;
};
;
export
type
patchSiteInformationSocialsIdResponse
=
(
patchSiteInformationSocialsIdResponseSuccess
)
export
const
getPatchSiteInformationSocialsIdUrl
=
(
id
:
string
,)
=>
{
return
`/siteInformation/socials/
${
id
}
`
}
export
const
patchSiteInformationSocialsId
=
async
(
id
:
string
,
siteInformationSocialMutate
:
SiteInformationSocialMutate
,
options
?:
RequestInit
):
Promise
<
patchSiteInformationSocialsIdResponse
>
=>
{
return
useCustomClient
<
patchSiteInformationSocialsIdResponse
>
(
getPatchSiteInformationSocialsIdUrl
(
id
),
{
...
options
,
method
:
'PATCH'
,
headers
:
{
'Content-Type'
:
'application/json'
,
...
options
?.
headers
},
body
:
JSON
.
stringify
(
siteInformationSocialMutate
,)
}
);}
export
const
getPatchSiteInformationSocialsIdMutationOptions
=
<
TError
=
ErrorType
<
unknown
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationSocialsId
>>
,
TError
,{
id
:
string
;
data
:
BodyType
<
SiteInformationSocialMutate
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationSocialsId
>>
,
TError
,{
id
:
string
;
data
:
BodyType
<
SiteInformationSocialMutate
>
},
TContext
>
=>
{
const
mutationKey
=
[
'patchSiteInformationSocialsId'
];
const
{
mutation
:
mutationOptions
,
request
:
requestOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
:
{...
options
,
mutation
:
{...
options
.
mutation
,
mutationKey
}}
:
{
mutation
:
{
mutationKey
,
},
request
:
undefined
};
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationSocialsId
>>
,
{
id
:
string
;
data
:
BodyType
<
SiteInformationSocialMutate
>
}
>
=
(
props
)
=>
{
const
{
id
,
data
}
=
props
??
{};
return
patchSiteInformationSocialsId
(
id
,
data
,
requestOptions
)
}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
PatchSiteInformationSocialsIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationSocialsId
>>>
export
type
PatchSiteInformationSocialsIdMutationBody
=
BodyType
<
SiteInformationSocialMutate
>
export
type
PatchSiteInformationSocialsIdMutationError
=
ErrorType
<
unknown
>
/**
* @summary Update fixed site social link
*/
export
const
usePatchSiteInformationSocialsId
=
<
TError
=
ErrorType
<
unknown
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationSocialsId
>>
,
TError
,{
id
:
string
;
data
:
BodyType
<
SiteInformationSocialMutate
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationSocialsId
>>
,
TError
,
{
id
:
string
;
data
:
BodyType
<
SiteInformationSocialMutate
>
},
TContext
>
=>
{
const
mutationOptions
=
getPatchSiteInformationSocialsIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
/**
* @summary Get fixed site social links
*/
export
type
getSiteInformationSocialsResponse200
=
{
data
:
void
status
:
200
}
export
type
getSiteInformationSocialsResponseSuccess
=
(
getSiteInformationSocialsResponse200
)
&
{
headers
:
Headers
;
};
;
export
type
getSiteInformationSocialsResponse
=
(
getSiteInformationSocialsResponseSuccess
)
export
const
getGetSiteInformationSocialsUrl
=
()
=>
{
return
`/siteInformation/socials`
}
export
const
getSiteInformationSocials
=
async
(
options
?:
RequestInit
):
Promise
<
getSiteInformationSocialsResponse
>
=>
{
return
useCustomClient
<
getSiteInformationSocialsResponse
>
(
getGetSiteInformationSocialsUrl
(),
{
...
options
,
method
:
'GET'
}
);}
export
const
getGetSiteInformationSocialsInfiniteQueryKey
=
()
=>
{
return
[
'infinite'
,
`/siteInformation/socials`
]
as
const
;
}
export
const
getGetSiteInformationSocialsQueryKey
=
()
=>
{
return
[
`/siteInformation/socials`
]
as
const
;
}
export
const
getGetSiteInformationSocialsInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
)
=>
{
const
{
query
:
queryOptions
,
request
:
requestOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetSiteInformationSocialsInfiniteQueryKey
();
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>>
=
({
signal
})
=>
getSiteInformationSocials
({
signal
,
...
requestOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
export
type
GetSiteInformationSocialsInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>>
export
type
GetSiteInformationSocialsInfiniteQueryError
=
ErrorType
<
unknown
>
export
function
useGetSiteInformationSocialsInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>>
,
TError
=
ErrorType
<
unknown
>>
(
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformationSocialsInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformationSocialsInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
* @summary Get fixed site social links
*/
export
function
useGetSiteInformationSocialsInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetSiteInformationSocialsInfiniteQueryOptions
(
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
query
.
queryKey
=
queryOptions
.
queryKey
;
return
query
;
}
/**
* @summary Get fixed site social links
*/
export
const
prefetchGetSiteInformationSocialsInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
=
ErrorType
<
unknown
>>
(
queryClient
:
QueryClient
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetSiteInformationSocialsInfiniteQueryOptions
(
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
return
queryClient
;
}
export
const
getGetSiteInformationSocialsQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
)
=>
{
const
{
query
:
queryOptions
,
request
:
requestOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetSiteInformationSocialsQueryKey
();
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>>
=
({
signal
})
=>
getSiteInformationSocials
({
signal
,
...
requestOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
export
type
GetSiteInformationSocialsQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>>
export
type
GetSiteInformationSocialsQueryError
=
ErrorType
<
unknown
>
export
function
useGetSiteInformationSocials
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
=
ErrorType
<
unknown
>>
(
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformationSocials
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformationSocials
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
* @summary Get fixed site social links
*/
export
function
useGetSiteInformationSocials
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetSiteInformationSocialsQueryOptions
(
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
query
.
queryKey
=
queryOptions
.
queryKey
;
return
query
;
}
/**
* @summary Get fixed site social links
*/
export
const
prefetchGetSiteInformationSocialsQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
=
ErrorType
<
unknown
>>
(
queryClient
:
QueryClient
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationSocials
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetSiteInformationSocialsQueryOptions
(
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
return
queryClient
;
}
/**
* @summary Update site information branch
*/
export
type
patchSiteInformationBranchesIdResponse200
=
{
data
:
void
status
:
200
}
export
type
patchSiteInformationBranchesIdResponseSuccess
=
(
patchSiteInformationBranchesIdResponse200
)
&
{
headers
:
Headers
;
};
;
export
type
patchSiteInformationBranchesIdResponse
=
(
patchSiteInformationBranchesIdResponseSuccess
)
export
const
getPatchSiteInformationBranchesIdUrl
=
(
id
:
string
,)
=>
{
return
`/siteInformation/branches/
${
id
}
`
}
export
const
patchSiteInformationBranchesId
=
async
(
id
:
string
,
siteInformationBranchMutate
:
SiteInformationBranchMutate
,
options
?:
RequestInit
):
Promise
<
patchSiteInformationBranchesIdResponse
>
=>
{
return
useCustomClient
<
patchSiteInformationBranchesIdResponse
>
(
getPatchSiteInformationBranchesIdUrl
(
id
),
{
...
options
,
method
:
'PATCH'
,
headers
:
{
'Content-Type'
:
'application/json'
,
...
options
?.
headers
},
body
:
JSON
.
stringify
(
siteInformationBranchMutate
,)
}
);}
export
const
getPatchSiteInformationBranchesIdMutationOptions
=
<
TError
=
ErrorType
<
unknown
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationBranchesId
>>
,
TError
,{
id
:
string
;
data
:
BodyType
<
SiteInformationBranchMutate
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationBranchesId
>>
,
TError
,{
id
:
string
;
data
:
BodyType
<
SiteInformationBranchMutate
>
},
TContext
>
=>
{
const
mutationKey
=
[
'patchSiteInformationBranchesId'
];
const
{
mutation
:
mutationOptions
,
request
:
requestOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
:
{...
options
,
mutation
:
{...
options
.
mutation
,
mutationKey
}}
:
{
mutation
:
{
mutationKey
,
},
request
:
undefined
};
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationBranchesId
>>
,
{
id
:
string
;
data
:
BodyType
<
SiteInformationBranchMutate
>
}
>
=
(
props
)
=>
{
const
{
id
,
data
}
=
props
??
{};
return
patchSiteInformationBranchesId
(
id
,
data
,
requestOptions
)
}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
PatchSiteInformationBranchesIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationBranchesId
>>>
export
type
PatchSiteInformationBranchesIdMutationBody
=
BodyType
<
SiteInformationBranchMutate
>
export
type
PatchSiteInformationBranchesIdMutationError
=
ErrorType
<
unknown
>
/**
* @summary Update site information branch
*/
export
const
usePatchSiteInformationBranchesId
=
<
TError
=
ErrorType
<
unknown
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationBranchesId
>>
,
TError
,{
id
:
string
;
data
:
BodyType
<
SiteInformationBranchMutate
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
patchSiteInformationBranchesId
>>
,
TError
,
{
id
:
string
;
data
:
BodyType
<
SiteInformationBranchMutate
>
},
TContext
>
=>
{
const
mutationOptions
=
getPatchSiteInformationBranchesIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
/**
* @summary Delete site information branch
*/
export
type
deleteSiteInformationBranchesIdResponse200
=
{
data
:
void
status
:
200
}
export
type
deleteSiteInformationBranchesIdResponseSuccess
=
(
deleteSiteInformationBranchesIdResponse200
)
&
{
headers
:
Headers
;
};
;
export
type
deleteSiteInformationBranchesIdResponse
=
(
deleteSiteInformationBranchesIdResponseSuccess
)
export
const
getDeleteSiteInformationBranchesIdUrl
=
(
id
:
string
,)
=>
{
return
`/siteInformation/branches/
${
id
}
`
}
export
const
deleteSiteInformationBranchesId
=
async
(
id
:
string
,
options
?:
RequestInit
):
Promise
<
deleteSiteInformationBranchesIdResponse
>
=>
{
return
useCustomClient
<
deleteSiteInformationBranchesIdResponse
>
(
getDeleteSiteInformationBranchesIdUrl
(
id
),
{
...
options
,
method
:
'DELETE'
}
);}
export
const
getDeleteSiteInformationBranchesIdMutationOptions
=
<
TError
=
ErrorType
<
unknown
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteSiteInformationBranchesId
>>
,
TError
,{
id
:
string
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteSiteInformationBranchesId
>>
,
TError
,{
id
:
string
},
TContext
>
=>
{
const
mutationKey
=
[
'deleteSiteInformationBranchesId'
];
const
{
mutation
:
mutationOptions
,
request
:
requestOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
:
{...
options
,
mutation
:
{...
options
.
mutation
,
mutationKey
}}
:
{
mutation
:
{
mutationKey
,
},
request
:
undefined
};
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
deleteSiteInformationBranchesId
>>
,
{
id
:
string
}
>
=
(
props
)
=>
{
const
{
id
}
=
props
??
{};
return
deleteSiteInformationBranchesId
(
id
,
requestOptions
)
}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
DeleteSiteInformationBranchesIdMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
deleteSiteInformationBranchesId
>>>
export
type
DeleteSiteInformationBranchesIdMutationError
=
ErrorType
<
unknown
>
/**
* @summary Delete site information branch
*/
export
const
useDeleteSiteInformationBranchesId
=
<
TError
=
ErrorType
<
unknown
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
deleteSiteInformationBranchesId
>>
,
TError
,{
id
:
string
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
deleteSiteInformationBranchesId
>>
,
TError
,
{
id
:
string
},
TContext
>
=>
{
const
mutationOptions
=
getDeleteSiteInformationBranchesIdMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
/**
* @summary Get site information branches
*/
export
type
getSiteInformationBranchesResponse200
=
{
data
:
void
status
:
200
}
export
type
getSiteInformationBranchesResponseSuccess
=
(
getSiteInformationBranchesResponse200
)
&
{
headers
:
Headers
;
};
;
export
type
getSiteInformationBranchesResponse
=
(
getSiteInformationBranchesResponseSuccess
)
export
const
getGetSiteInformationBranchesUrl
=
()
=>
{
return
`/siteInformation/branches`
}
export
const
getSiteInformationBranches
=
async
(
options
?:
RequestInit
):
Promise
<
getSiteInformationBranchesResponse
>
=>
{
return
useCustomClient
<
getSiteInformationBranchesResponse
>
(
getGetSiteInformationBranchesUrl
(),
{
...
options
,
method
:
'GET'
}
);}
export
const
getGetSiteInformationBranchesInfiniteQueryKey
=
()
=>
{
return
[
'infinite'
,
`/siteInformation/branches`
]
as
const
;
}
export
const
getGetSiteInformationBranchesQueryKey
=
()
=>
{
return
[
`/siteInformation/branches`
]
as
const
;
}
export
const
getGetSiteInformationBranchesInfiniteQueryOptions
=
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
)
=>
{
const
{
query
:
queryOptions
,
request
:
requestOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetSiteInformationBranchesInfiniteQueryKey
();
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>>
=
({
signal
})
=>
getSiteInformationBranches
({
signal
,
...
requestOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
export
type
GetSiteInformationBranchesInfiniteQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>>
export
type
GetSiteInformationBranchesInfiniteQueryError
=
ErrorType
<
unknown
>
export
function
useGetSiteInformationBranchesInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>>
,
TError
=
ErrorType
<
unknown
>>
(
options
:
{
query
:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
DefinedUseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformationBranchesInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformationBranchesInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
* @summary Get site information branches
*/
export
function
useGetSiteInformationBranchesInfinite
<
TData
=
InfiniteData
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetSiteInformationBranchesInfiniteQueryOptions
(
options
)
const
query
=
useInfiniteQuery
(
queryOptions
,
queryClient
)
as
UseInfiniteQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
query
.
queryKey
=
queryOptions
.
queryKey
;
return
query
;
}
/**
* @summary Get site information branches
*/
export
const
prefetchGetSiteInformationBranchesInfiniteQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
=
ErrorType
<
unknown
>>
(
queryClient
:
QueryClient
,
options
?:
{
query
?:
Partial
<
UseInfiniteQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetSiteInformationBranchesInfiniteQueryOptions
(
options
)
await
queryClient
.
prefetchInfiniteQuery
(
queryOptions
);
return
queryClient
;
}
export
const
getGetSiteInformationBranchesQueryOptions
=
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
)
=>
{
const
{
query
:
queryOptions
,
request
:
requestOptions
}
=
options
??
{};
const
queryKey
=
queryOptions
?.
queryKey
??
getGetSiteInformationBranchesQueryKey
();
const
queryFn
:
QueryFunction
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>>
=
({
signal
})
=>
getSiteInformationBranches
({
signal
,
...
requestOptions
});
return
{
queryKey
,
queryFn
,
retry
:
3
,
retryDelay
:
1000
,
...
queryOptions
}
as
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
}
export
type
GetSiteInformationBranchesQueryResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>>
export
type
GetSiteInformationBranchesQueryError
=
ErrorType
<
unknown
>
export
function
useGetSiteInformationBranches
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
=
ErrorType
<
unknown
>>
(
options
:
{
query
:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
&
Pick
<
DefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
DefinedUseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformationBranches
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
&
Pick
<
UndefinedInitialDataOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
>
,
'initialData'
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
export
function
useGetSiteInformationBranches
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
/**
* @summary Get site information branches
*/
export
function
useGetSiteInformationBranches
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
=
ErrorType
<
unknown
>>
(
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
}
{
const
queryOptions
=
getGetSiteInformationBranchesQueryOptions
(
options
)
const
query
=
useQuery
(
queryOptions
,
queryClient
)
as
UseQueryResult
<
TData
,
TError
>
&
{
queryKey
:
DataTag
<
QueryKey
,
TData
,
TError
>
};
query
.
queryKey
=
queryOptions
.
queryKey
;
return
query
;
}
/**
* @summary Get site information branches
*/
export
const
prefetchGetSiteInformationBranchesQuery
=
async
<
TData
=
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
=
ErrorType
<
unknown
>>
(
queryClient
:
QueryClient
,
options
?:
{
query
?:
Partial
<
UseQueryOptions
<
Awaited
<
ReturnType
<
typeof
getSiteInformationBranches
>>
,
TError
,
TData
>>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
Promise
<
QueryClient
>
=>
{
const
queryOptions
=
getGetSiteInformationBranchesQueryOptions
(
options
)
await
queryClient
.
prefetchQuery
(
queryOptions
);
return
queryClient
;
}
/**
* @summary Create site information branch
*/
export
type
postSiteInformationBranchesResponse200
=
{
data
:
void
status
:
200
}
export
type
postSiteInformationBranchesResponseSuccess
=
(
postSiteInformationBranchesResponse200
)
&
{
headers
:
Headers
;
};
;
export
type
postSiteInformationBranchesResponse
=
(
postSiteInformationBranchesResponseSuccess
)
export
const
getPostSiteInformationBranchesUrl
=
()
=>
{
return
`/siteInformation/branches`
}
export
const
postSiteInformationBranches
=
async
(
siteInformationBranchMutate
:
SiteInformationBranchMutate
,
options
?:
RequestInit
):
Promise
<
postSiteInformationBranchesResponse
>
=>
{
return
useCustomClient
<
postSiteInformationBranchesResponse
>
(
getPostSiteInformationBranchesUrl
(),
{
...
options
,
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
,
...
options
?.
headers
},
body
:
JSON
.
stringify
(
siteInformationBranchMutate
,)
}
);}
export
const
getPostSiteInformationBranchesMutationOptions
=
<
TError
=
ErrorType
<
unknown
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postSiteInformationBranches
>>
,
TError
,{
data
:
BodyType
<
SiteInformationBranchMutate
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
):
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postSiteInformationBranches
>>
,
TError
,{
data
:
BodyType
<
SiteInformationBranchMutate
>
},
TContext
>
=>
{
const
mutationKey
=
[
'postSiteInformationBranches'
];
const
{
mutation
:
mutationOptions
,
request
:
requestOptions
}
=
options
?
options
.
mutation
&&
'mutationKey'
in
options
.
mutation
&&
options
.
mutation
.
mutationKey
?
options
:
{...
options
,
mutation
:
{...
options
.
mutation
,
mutationKey
}}
:
{
mutation
:
{
mutationKey
,
},
request
:
undefined
};
const
mutationFn
:
MutationFunction
<
Awaited
<
ReturnType
<
typeof
postSiteInformationBranches
>>
,
{
data
:
BodyType
<
SiteInformationBranchMutate
>
}
>
=
(
props
)
=>
{
const
{
data
}
=
props
??
{};
return
postSiteInformationBranches
(
data
,
requestOptions
)
}
return
{
mutationFn
,
...
mutationOptions
}}
export
type
PostSiteInformationBranchesMutationResult
=
NonNullable
<
Awaited
<
ReturnType
<
typeof
postSiteInformationBranches
>>>
export
type
PostSiteInformationBranchesMutationBody
=
BodyType
<
SiteInformationBranchMutate
>
export
type
PostSiteInformationBranchesMutationError
=
ErrorType
<
unknown
>
/**
* @summary Create site information branch
*/
export
const
usePostSiteInformationBranches
=
<
TError
=
ErrorType
<
unknown
>
,
TContext
=
unknown
>
(
options
?:
{
mutation
?:
UseMutationOptions
<
Awaited
<
ReturnType
<
typeof
postSiteInformationBranches
>>
,
TError
,{
data
:
BodyType
<
SiteInformationBranchMutate
>
},
TContext
>
,
request
?:
SecondParameter
<
typeof
useCustomClient
>
}
,
queryClient
?:
QueryClient
):
UseMutationResult
<
Awaited
<
ReturnType
<
typeof
postSiteInformationBranches
>>
,
TError
,
{
data
:
BodyType
<
SiteInformationBranchMutate
>
},
TContext
>
=>
{
const
mutationOptions
=
getPostSiteInformationBranchesMutationOptions
(
options
);
return
useMutation
(
mutationOptions
,
queryClient
);
}
\ No newline at end of file
src/api/models/banner.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
export
interface
Banner
{
id
?:
string
;
banner_name
?:
string
;
display_order
?:
number
;
status
?:
string
;
file_id
?:
string
;
created_at
?:
string
;
created_by
?:
string
;
updated_at
?:
string
;
updated_by
?:
string
;
display_time
?:
number
;
}
src/api/models/bannerMutate.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
export
interface
BannerMutate
{
banner_name
?:
string
;
display_order
?:
number
;
status
?:
string
;
file_id
?:
string
;
display_time
?:
number
;
}
src/api/models/deleteLogoId200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
DeleteLogoId200AllOf
}
from
'./deleteLogoId200AllOf'
;
export
type
DeleteLogoId200
=
ApiResponse
&
DeleteLogoId200AllOf
;
src/api/models/deleteLogoId200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
export
type
DeleteLogoId200AllOf
=
{
responseData
?:
boolean
;
};
src/api/models/getApiV10NewsletterSubscriptionParams.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
FiltersParameter
}
from
'./filtersParameter'
;
import
type
{
SortFieldParameter
}
from
'./sortFieldParameter'
;
import
type
{
SortOrderParameter
}
from
'./sortOrderParameter'
;
import
type
{
PageParameter
}
from
'./pageParameter'
;
import
type
{
PageSizeParameter
}
from
'./pageSizeParameter'
;
export
type
GetApiV10NewsletterSubscriptionParams
=
{
/**
* filter, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
filters
?:
FiltersParameter
;
/**
* sortField, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortField
?:
SortFieldParameter
;
/**
* sort order, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortOrder
?:
SortOrderParameter
;
/**
* page, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
page
?:
PageParameter
;
/**
* pageSize, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
pageSize
?:
PageSizeParameter
;
};
src/api/models/getApiV10SiteInformation200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
GetApiV10SiteInformation200AllOf
}
from
'./getApiV10SiteInformation200AllOf'
;
export
type
GetApiV10SiteInformation200
=
ApiResponse
&
GetApiV10SiteInformation200AllOf
;
src/api/models/getApiV10SiteInformation200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
SiteInformationData
}
from
'./siteInformationData'
;
export
type
GetApiV10SiteInformation200AllOf
=
{
responseData
?:
SiteInformationData
;
};
src/api/models/getApiV10SiteInformationParams.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
FiltersParameter
}
from
'./filtersParameter'
;
import
type
{
SortFieldParameter
}
from
'./sortFieldParameter'
;
import
type
{
SortOrderParameter
}
from
'./sortOrderParameter'
;
import
type
{
PageParameter
}
from
'./pageParameter'
;
import
type
{
PageSizeParameter
}
from
'./pageSizeParameter'
;
export
type
GetApiV10SiteInformationParams
=
{
/**
* filter, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
filters
?:
FiltersParameter
;
/**
* sortField, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortField
?:
SortFieldParameter
;
/**
* sort order, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortOrder
?:
SortOrderParameter
;
/**
* page, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
page
?:
PageParameter
;
/**
* pageSize, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
pageSize
?:
PageSizeParameter
;
};
src/api/models/getApiV10VideoId200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
GetApiV10VideoId200AllOf
}
from
'./getApiV10VideoId200AllOf'
;
export
type
GetApiV10VideoId200
=
ApiResponse
&
GetApiV10VideoId200AllOf
;
src/api/models/getApiV10VideoId200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
Video
}
from
'./video'
;
export
type
GetApiV10VideoId200AllOf
=
{
responseData
?:
Video
;
};
src/api/models/getApiV10VideoParams.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
FiltersParameter
}
from
'./filtersParameter'
;
import
type
{
SortFieldParameter
}
from
'./sortFieldParameter'
;
import
type
{
SortOrderParameter
}
from
'./sortOrderParameter'
;
import
type
{
PageParameter
}
from
'./pageParameter'
;
import
type
{
PageSizeParameter
}
from
'./pageSizeParameter'
;
export
type
GetApiV10VideoParams
=
{
/**
* filter, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
filters
?:
FiltersParameter
;
/**
* sortField, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortField
?:
SortFieldParameter
;
/**
* sort order, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortOrder
?:
SortOrderParameter
;
/**
* page, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
page
?:
PageParameter
;
/**
* pageSize, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
pageSize
?:
PageSizeParameter
;
};
src/api/models/getLogoId200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
GetLogoId200AllOf
}
from
'./getLogoId200AllOf'
;
export
type
GetLogoId200
=
ApiResponse
&
GetLogoId200AllOf
;
src/api/models/getLogoId200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
Logo
}
from
'./logo'
;
export
type
GetLogoId200AllOf
=
{
responseData
?:
Logo
;
};
src/api/models/getLogoParams.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
FiltersParameter
}
from
'./filtersParameter'
;
import
type
{
SortFieldParameter
}
from
'./sortFieldParameter'
;
import
type
{
SortOrderParameter
}
from
'./sortOrderParameter'
;
import
type
{
PageParameter
}
from
'./pageParameter'
;
import
type
{
PageSizeParameter
}
from
'./pageSizeParameter'
;
export
type
GetLogoParams
=
{
/**
* filter, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
filters
?:
FiltersParameter
;
/**
* sortField, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortField
?:
SortFieldParameter
;
/**
* sort order, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortOrder
?:
SortOrderParameter
;
/**
* page, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
page
?:
PageParameter
;
/**
* pageSize, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
pageSize
?:
PageSizeParameter
;
};
src/api/models/getSiteInformation200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
GetSiteInformation200AllOf
}
from
'./getSiteInformation200AllOf'
;
export
type
GetSiteInformation200
=
ApiResponse
&
GetSiteInformation200AllOf
;
src/api/models/getSiteInformation200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
SiteInformationData
}
from
'./siteInformationData'
;
export
type
GetSiteInformation200AllOf
=
{
responseData
?:
SiteInformationData
;
};
src/api/models/getSiteInformationParams.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
FiltersParameter
}
from
'./filtersParameter'
;
import
type
{
SortFieldParameter
}
from
'./sortFieldParameter'
;
import
type
{
SortOrderParameter
}
from
'./sortOrderParameter'
;
import
type
{
PageParameter
}
from
'./pageParameter'
;
import
type
{
PageSizeParameter
}
from
'./pageSizeParameter'
;
export
type
GetSiteInformationParams
=
{
/**
* filter, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
filters
?:
FiltersParameter
;
/**
* sortField, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortField
?:
SortFieldParameter
;
/**
* sort order, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortOrder
?:
SortOrderParameter
;
/**
* page, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
page
?:
PageParameter
;
/**
* pageSize, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
pageSize
?:
PageSizeParameter
;
};
src/api/models/index.ts
View file @
8c9baba4
...
...
@@ -16,6 +16,8 @@ export * from './badRequestResponseError';
export
*
from
'./badRequestResponseErrorMessage'
;
export
*
from
'./badRequestResponseResponseData'
;
export
*
from
'./badRequestResponseViolationItem'
;
export
*
from
'./banner'
;
export
*
from
'./bannerMutate'
;
export
*
from
'./business'
;
export
*
from
'./businessCreate'
;
export
*
from
'./businessDeleteResponse'
;
...
...
@@ -51,6 +53,8 @@ export * from './deleteContactId200AllOf';
export
*
from
'./deleteEventsLinkParams'
;
export
*
from
'./deleteEventsParams'
;
export
*
from
'./deleteFilesBody'
;
export
*
from
'./deleteLogoId200'
;
export
*
from
'./deleteLogoId200AllOf'
;
export
*
from
'./deleteMembershipFeeParams'
;
export
*
from
'./deleteNewsParams'
;
export
*
from
'./deleteNotificationsParams'
;
...
...
@@ -93,7 +97,14 @@ export * from './getApiV10CategoryParams';
export
*
from
'./getApiV10ContactId200'
;
export
*
from
'./getApiV10ContactId200AllOf'
;
export
*
from
'./getApiV10ContactParams'
;
export
*
from
'./getApiV10NewsletterSubscriptionParams'
;
export
*
from
'./getApiV10PageConfigParams'
;
export
*
from
'./getApiV10SiteInformation200'
;
export
*
from
'./getApiV10SiteInformation200AllOf'
;
export
*
from
'./getApiV10SiteInformationParams'
;
export
*
from
'./getApiV10VideoId200'
;
export
*
from
'./getApiV10VideoId200AllOf'
;
export
*
from
'./getApiV10VideoParams'
;
export
*
from
'./getApprovalParams'
;
export
*
from
'./getCategoryId200'
;
export
*
from
'./getCategoryId200AllOf'
;
...
...
@@ -109,6 +120,9 @@ export * from './getEventsMyEventsParams';
export
*
from
'./getEventsParams'
;
export
*
from
'./getEventsSlugSlugParams'
;
export
*
from
'./getFooterParams'
;
export
*
from
'./getLogoId200'
;
export
*
from
'./getLogoId200AllOf'
;
export
*
from
'./getLogoParams'
;
export
*
from
'./getMembershipFeeParams'
;
export
*
from
'./getMembershipFeePrintParams'
;
export
*
from
'./getNewsAdminParams'
;
...
...
@@ -136,6 +150,9 @@ export * from './getProductsParams';
export
*
from
'./getScheduleGetMyScheduleParams'
;
export
*
from
'./getScheduleGetScheduledTimeByEventEventIdParams'
;
export
*
from
'./getScheduleManageMyScheduleParams'
;
export
*
from
'./getSiteInformation200'
;
export
*
from
'./getSiteInformation200AllOf'
;
export
*
from
'./getSiteInformationParams'
;
export
*
from
'./getStatisticMemberByMonthParams'
;
export
*
from
'./getStatisticMembershipFeeByMonthParams'
;
export
*
from
'./getStatisticSiteAccessParams'
;
...
...
@@ -219,6 +236,10 @@ export * from './pageConfigTag';
export
*
from
'./pageConfigTagMutate'
;
export
*
from
'./pageParameter'
;
export
*
from
'./pageSizeParameter'
;
export
*
from
'./patchApiV10NewsletterSubscriptionId200'
;
export
*
from
'./patchApiV10NewsletterSubscriptionId200AllOf'
;
export
*
from
'./patchApiV10VideoId200'
;
export
*
from
'./patchApiV10VideoId200AllOf'
;
export
*
from
'./patchNewsletterSubscriptionId200'
;
export
*
from
'./patchNewsletterSubscriptionId200AllOf'
;
export
*
from
'./patchVideoId200'
;
...
...
@@ -239,7 +260,11 @@ export * from './postApiV10Category200';
export
*
from
'./postApiV10Category200AllOf'
;
export
*
from
'./postApiV10Contact200'
;
export
*
from
'./postApiV10Contact200AllOf'
;
export
*
from
'./postApiV10NewsletterSubscription200'
;
export
*
from
'./postApiV10NewsletterSubscription200AllOf'
;
export
*
from
'./postApiV10PageConfigBody'
;
export
*
from
'./postApiV10Video200'
;
export
*
from
'./postApiV10Video200AllOf'
;
export
*
from
'./postAuthForgotPasswordBody'
;
export
*
from
'./postCategory'
;
export
*
from
'./postCategory200'
;
...
...
@@ -253,6 +278,8 @@ export * from './postContentStructure';
export
*
from
'./postEventsIdExportJoinedOrgsMode'
;
export
*
from
'./postEventsIdExportJoinedOrgsParams'
;
export
*
from
'./postFilesBody'
;
export
*
from
'./postLogo200'
;
export
*
from
'./postLogo200AllOf'
;
export
*
from
'./postMembershipFeeCreateAccountsAndFeesBody'
;
export
*
from
'./postMembershipFeeCreateAccountsAndFeesBodyOrganizationsItem'
;
export
*
from
'./postMembershipFeeSendUpdateReminderBody'
;
...
...
@@ -283,6 +310,8 @@ export * from './putApiV10CategoryId200AllOf';
export
*
from
'./putApiV10ContactId200'
;
export
*
from
'./putApiV10ContactId200AllOf'
;
export
*
from
'./putApiV10PageConfigIdBody'
;
export
*
from
'./putApiV10SiteInformation200'
;
export
*
from
'./putApiV10SiteInformation200AllOf'
;
export
*
from
'./putAuthAssignBusinessInterestBody'
;
export
*
from
'./putAuthUpdatePasswordBody'
;
export
*
from
'./putCategoryId200'
;
...
...
@@ -293,6 +322,8 @@ export * from './putContactId200AllOf';
export
*
from
'./putEventsLinkParams'
;
export
*
from
'./putEventsParams'
;
export
*
from
'./putFooterParams'
;
export
*
from
'./putLogoId200'
;
export
*
from
'./putLogoId200AllOf'
;
export
*
from
'./putMembershipFeeParams'
;
export
*
from
'./putNewsPageConfigCategoryIdBody'
;
export
*
from
'./putNotificationsMarkAsReadParams'
;
...
...
@@ -305,6 +336,8 @@ export * from './putOrganizationsParams';
export
*
from
'./putPageConfigIdBody'
;
export
*
from
'./putPermisionFunctionParams'
;
export
*
from
'./putProductsParams'
;
export
*
from
'./putSiteInformation200'
;
export
*
from
'./putSiteInformation200AllOf'
;
export
*
from
'./putUserDepartmentParams'
;
export
*
from
'./putUserHistoryParams'
;
export
*
from
'./refreshToken'
;
...
...
@@ -329,14 +362,20 @@ export * from './rolePermissionMutate';
export
*
from
'./roleUpdate'
;
export
*
from
'./schemaMigration'
;
export
*
from
'./schemaMigrationMutate'
;
export
*
from
'./sequelizemeta'
;
export
*
from
'./sequelizemetaMutate'
;
export
*
from
'./siteInformation'
;
export
*
from
'./siteInformationBranch'
;
export
*
from
'./siteInformationBranchMutate'
;
export
*
from
'./siteInformationData'
;
export
*
from
'./siteInformationDataLogo'
;
export
*
from
'./siteInformationLinkSocials'
;
export
*
from
'./siteInformationMutate'
;
export
*
from
'./siteInformationMutateLinkSocials'
;
export
*
from
'./siteInformationResponse'
;
export
*
from
'./siteInformationResponseAllOf'
;
export
*
from
'./siteInformationSocialLink'
;
export
*
from
'./siteInformationSocialMutate'
;
export
*
from
'./siteInformationUpdateBody'
;
export
*
from
'./sortFieldParameter'
;
export
*
from
'./sortOrderParameter'
;
...
...
src/api/models/logo.ts
View file @
8c9baba4
...
...
@@ -5,15 +5,14 @@
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
LogoFile
}
from
'./logoFile'
;
export
interface
Logo
{
id
:
string
;
/** @maxLength 255 */
logo_name
:
string
;
/** @nullable */
description
?:
string
|
null
;
file_id
:
LogoFile
;
logo_url
?:
string
|
null
;
file_id
:
string
;
created_at
:
string
;
/** @nullable */
created_by
?:
string
|
null
;
...
...
src/api/models/logoCreate.ts
View file @
8c9baba4
...
...
@@ -10,6 +10,6 @@ export interface LogoCreate {
/** @maxLength 255 */
logo_name
:
string
;
/** @nullable */
description
?:
string
|
null
;
logo_url
?:
string
|
null
;
file_id
:
string
;
}
src/api/models/logoUpdate.ts
View file @
8c9baba4
...
...
@@ -10,6 +10,6 @@ export interface LogoUpdate {
/** @maxLength 255 */
logo_name
?:
string
;
/** @nullable */
description
?:
string
|
null
;
logo_url
?:
string
|
null
;
file_id
?:
string
;
}
src/api/models/patchApiV10NewsletterSubscriptionId200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
PatchApiV10NewsletterSubscriptionId200AllOf
}
from
'./patchApiV10NewsletterSubscriptionId200AllOf'
;
export
type
PatchApiV10NewsletterSubscriptionId200
=
ApiResponse
&
PatchApiV10NewsletterSubscriptionId200AllOf
;
src/api/models/patchApiV10NewsletterSubscriptionId200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
NewsletterSubscription
}
from
'./newsletterSubscription'
;
export
type
PatchApiV10NewsletterSubscriptionId200AllOf
=
{
responseData
?:
NewsletterSubscription
;
};
src/api/models/patchApiV10VideoId200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
PatchApiV10VideoId200AllOf
}
from
'./patchApiV10VideoId200AllOf'
;
export
type
PatchApiV10VideoId200
=
ApiResponse
&
PatchApiV10VideoId200AllOf
;
src/api/models/patchApiV10VideoId200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
Video
}
from
'./video'
;
export
type
PatchApiV10VideoId200AllOf
=
{
responseData
?:
Video
;
};
src/api/models/postApiV10NewsletterSubscription200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
PostApiV10NewsletterSubscription200AllOf
}
from
'./postApiV10NewsletterSubscription200AllOf'
;
export
type
PostApiV10NewsletterSubscription200
=
ApiResponse
&
PostApiV10NewsletterSubscription200AllOf
;
src/api/models/postApiV10NewsletterSubscription200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
NewsletterSubscription
}
from
'./newsletterSubscription'
;
export
type
PostApiV10NewsletterSubscription200AllOf
=
{
responseData
?:
NewsletterSubscription
;
};
src/api/models/postApiV10Video200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
PostApiV10Video200AllOf
}
from
'./postApiV10Video200AllOf'
;
export
type
PostApiV10Video200
=
ApiResponse
&
PostApiV10Video200AllOf
;
src/api/models/postApiV10Video200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
Video
}
from
'./video'
;
export
type
PostApiV10Video200AllOf
=
{
responseData
?:
Video
;
};
src/api/models/postLogo200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
PostLogo200AllOf
}
from
'./postLogo200AllOf'
;
export
type
PostLogo200
=
ApiResponse
&
PostLogo200AllOf
;
src/api/models/postLogo200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
Logo
}
from
'./logo'
;
export
type
PostLogo200AllOf
=
{
responseData
?:
Logo
;
};
src/api/models/putApiV10SiteInformation200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
PutApiV10SiteInformation200AllOf
}
from
'./putApiV10SiteInformation200AllOf'
;
export
type
PutApiV10SiteInformation200
=
ApiResponse
&
PutApiV10SiteInformation200AllOf
;
src/api/models/putApiV10SiteInformation200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import
type
{
SiteInformationData
}
from
'./siteInformationData'
;
export
type
PutApiV10SiteInformation200AllOf
=
{
responseData
?:
SiteInformationData
;
};
src/api/models/putLogoId200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
PutLogoId200AllOf
}
from
'./putLogoId200AllOf'
;
export
type
PutLogoId200
=
ApiResponse
&
PutLogoId200AllOf
;
src/api/models/putLogoId200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
Logo
}
from
'./logo'
;
export
type
PutLogoId200AllOf
=
{
responseData
?:
Logo
;
};
src/api/models/putSiteInformation200.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
import
type
{
PutSiteInformation200AllOf
}
from
'./putSiteInformation200AllOf'
;
export
type
PutSiteInformation200
=
ApiResponse
&
PutSiteInformation200AllOf
;
src/api/models/putSiteInformation200AllOf.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
SiteInformationData
}
from
'./siteInformationData'
;
export
type
PutSiteInformation200AllOf
=
{
responseData
?:
SiteInformationData
;
};
src/api/models/sequelizemeta.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
export
interface
Sequelizemeta
{
name
?:
string
;
}
src/api/models/sequelizemetaMutate.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
export
interface
SequelizemetaMutate
{
name
?:
string
;
}
src/api/models/siteInformationBranch.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
export
interface
SiteInformationBranch
{
id
?:
string
;
/** @nullable */
branch_name
?:
string
|
null
;
/** @nullable */
hotline
?:
string
|
null
;
/** @nullable */
telephone
?:
string
|
null
;
/** @nullable */
email
?:
string
|
null
;
/** @nullable */
address
?:
string
|
null
;
/** @nullable */
fax
?:
string
|
null
;
/** @nullable */
googlemap_link
?:
string
|
null
;
sort_order
?:
number
;
is_active
?:
boolean
;
created_at
?:
string
;
/** @nullable */
created_by
?:
string
|
null
;
updated_at
?:
string
;
/** @nullable */
updated_by
?:
string
|
null
;
}
src/api/models/siteInformationBranchMutate.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
export
interface
SiteInformationBranchMutate
{
/** @nullable */
branch_name
?:
string
|
null
;
/** @nullable */
hotline
?:
string
|
null
;
/** @nullable */
email
?:
string
|
null
;
/** @nullable */
address
?:
string
|
null
;
/** @nullable */
fax
?:
string
|
null
;
/** @nullable */
googlemap_link
?:
string
|
null
;
sort_order
?:
number
;
is_active
?:
boolean
;
}
src/api/models/siteInformationData.ts
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
*
VietProDev CMS Backend API
*
Generated API documentation
*
Backend Template
*
Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
SiteInformationDataLogo
}
from
'./siteInformationDataLogo'
;
import
type
{
SiteInformationSocialLink
}
from
'./siteInformationSocialLink'
;
import
type
{
SiteInformationBranch
}
from
'./siteInformationBranch'
;
export
interface
SiteInformationData
{
id
?:
string
;
code
?:
string
;
/** @nullable */
website_name
?:
string
|
null
;
/** @nullable */
website_link
?:
string
|
null
;
/** @nullable */
logo
?:
SiteInformationDataLogo
;
/** @nullable */
telephone
?:
string
|
null
;
/** @nullable */
email
?:
string
|
null
;
...
...
@@ -19,6 +27,8 @@ export interface SiteInformationData {
/** @nullable */
working_hours
?:
string
|
null
;
link_socials
?:
SiteInformationSocialLink
[];
branches
?:
SiteInformationBranch
[];
socials
?:
SiteInformationSocialLink
[];
created_at
?:
string
;
/** @nullable */
created_by
?:
string
|
null
;
...
...
src/api/models/siteInformationDataLogo.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
Logo
}
from
'./logo'
;
/**
* @nullable
*/
export
type
SiteInformationDataLogo
=
Logo
|
null
;
src/api/models/siteInformationResponse.ts
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
*
VietProDev CMS Backend API
*
Generated API documentation
*
Backend Template
*
Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
ApiResponse
}
from
'./apiResponse'
;
...
...
src/api/models/siteInformationResponseAllOf.ts
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
*
VietProDev CMS Backend API
*
Generated API documentation
*
Backend Template
*
Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
SiteInformationData
}
from
'./siteInformationData'
;
...
...
src/api/models/siteInformationSocialLink.ts
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
*
VietProDev CMS Backend API
*
Generated API documentation
*
Backend Template
*
Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
export
interface
SiteInformationSocialLink
{
id
:
string
;
/** Social platform key (lowercase recommended) */
platform
:
string
;
/** Display label for the social platform */
label
:
string
;
/** Public URL to the social page */
url
:
string
;
/**
* Public URL to the social page
* @nullable
*/
url
?:
string
|
null
;
/** Icon key used by FE to render correct icon */
icon_key
:
string
;
/** Whether this social link is active */
is_active
:
boolean
;
/** Display order */
sort_order
:
number
;
}
src/api/models/siteInformationSocialMutate.ts
0 → 100644
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
export
interface
SiteInformationSocialMutate
{
/** @nullable */
url
?:
string
|
null
;
sort_order
?:
number
;
is_active
?:
boolean
;
}
src/api/models/siteInformationUpdateBody.ts
View file @
8c9baba4
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
*
VietProDev CMS Backend API
*
Generated API documentation
*
Backend Template
*
Coded by Meu TEAM
* OpenAPI spec version: 1.0.0
*/
import
type
{
SiteInformationSocialLink
}
from
'./siteInformationSocialLink'
;
...
...
@@ -11,6 +11,10 @@ export interface SiteInformationUpdateBody {
/** @nullable */
telephone
?:
string
|
null
;
/** @nullable */
website_name
?:
string
|
null
;
/** @nullable */
website_link
?:
string
|
null
;
/** @nullable */
email
?:
string
|
null
;
/** @nullable */
address
?:
string
|
null
;
...
...
src/app/admin/base-config/page.tsx
View file @
8c9baba4
...
...
@@ -35,6 +35,22 @@ import { Checkbox } from "@/components/ui/checkbox";
import
{
Switch
}
from
"@/components/ui/switch"
;
import
{
Tabs
,
TabsContent
,
TabsList
,
TabsTrigger
}
from
"@/components/ui/tabs"
;
import
{
Textarea
}
from
"@/components/ui/textarea"
;
import
{
deleteSiteInformationBranchesId
,
getSiteInformation
,
patchSiteInformationBranchesId
,
patchSiteInformationSocialsId
,
postSiteInformationBranches
,
putSiteInformation
,
}
from
"@/api/endpoints/site-information"
;
import
{
deleteLogoId
,
postLogo
,
putLogoId
}
from
"@/api/endpoints/logo"
;
import
type
{
SiteInformationBranch
,
SiteInformationBranchMutate
,
SiteInformationData
,
SiteInformationSocialLink
,
SiteInformationSocialMutate
,
}
from
"@/api/models"
;
import
type
{
AdminMediaItem
}
from
"@/mockdata/admin-news"
;
import
{
type
BaseConfigBannerItem
,
...
...
@@ -48,6 +64,7 @@ import {
persistBaseConfig
,
readBaseConfig
,
sortBaseConfigBanners
,
sortBaseConfigBranches
,
sortBaseConfigSocials
,
}
from
"@/mockdata/base-config"
;
...
...
@@ -55,6 +72,17 @@ const fieldClassName =
"rounded-xl border-[#063e8e]/15 bg-white text-gray-700 placeholder:text-gray-700 focus-visible:ring-[#063e8e]/30"
;
type
ConfigItemMode
=
"logo"
|
"banner"
;
type
ApiEnvelope
<
T
>
=
{
responseData
?:
T
;
data
?:
{
responseData
?:
T
;
};
};
type
LogoMediaItem
=
AdminMediaItem
&
{
logoId
?:
string
;
};
type
ConfigItemForm
=
{
name
:
string
;
imageId
:
string
;
...
...
@@ -77,6 +105,110 @@ function resolveMediaItem(mediaMap: Map<string, AdminMediaItem>, imageId: string
return
mediaMap
.
get
(
imageId
)
??
null
;
}
function
getEnvelopeData
<
T
>
(
payload
:
unknown
):
T
|
undefined
{
const
root
=
payload
as
ApiEnvelope
<
T
>
;
return
root
.
responseData
??
root
.
data
?.
responseData
;
}
function
mapApiBranchToConfig
(
branch
:
SiteInformationBranch
):
BaseConfigBranchItem
{
return
{
id
:
branch
.
id
??
createBaseConfigItemId
(
"branch"
),
branchName
:
branch
.
branch_name
??
""
,
address
:
branch
.
address
??
""
,
hotline
:
branch
.
hotline
??
branch
.
telephone
??
""
,
email
:
branch
.
email
??
""
,
fax
:
branch
.
fax
??
""
,
mapsEmbedUrl
:
branch
.
googlemap_link
??
""
,
sortOrder
:
branch
.
sort_order
??
1
,
isVisible
:
branch
.
is_active
??
true
,
};
}
function
mapConfigBranchToApi
(
branch
:
BaseConfigBranchItem
,
index
:
number
,
):
SiteInformationBranchMutate
{
return
{
branch_name
:
branch
.
branchName
.
trim
()
||
null
,
address
:
branch
.
address
.
trim
()
||
null
,
hotline
:
branch
.
hotline
.
trim
()
||
null
,
email
:
branch
.
email
.
trim
()
||
null
,
fax
:
branch
.
fax
.
trim
()
||
null
,
googlemap_link
:
branch
.
mapsEmbedUrl
.
trim
()
||
null
,
sort_order
:
Number
.
isFinite
(
branch
.
sortOrder
)
?
branch
.
sortOrder
:
index
+
1
,
is_active
:
branch
.
isVisible
,
};
}
function
mapApiSocialToConfig
(
social
:
SiteInformationSocialLink
):
BaseConfigSocialItem
{
return
{
id
:
social
.
id
,
label
:
social
.
label
,
url
:
social
.
url
??
""
,
isVisible
:
social
.
is_active
,
sortOrder
:
social
.
sort_order
,
};
}
function
mapConfigSocialToApi
(
social
:
BaseConfigSocialItem
):
SiteInformationSocialMutate
{
return
{
url
:
social
.
url
.
trim
()
||
null
,
sort_order
:
social
.
sortOrder
,
is_active
:
social
.
isVisible
,
};
}
function
mapSiteLogoToConfig
(
siteInformation
:
SiteInformationData
):
{
logo
:
BaseConfigLogoItem
|
null
;
media
:
LogoMediaItem
|
null
;
}
|
null
{
const
logo
=
siteInformation
.
logo
;
if
(
!
logo
)
return
null
;
const
media
:
LogoMediaItem
=
{
id
:
logo
.
file_id
,
logoId
:
logo
.
id
,
name
:
logo
.
logo_name
,
alt
:
logo
.
logo_name
,
url
:
logo
.
logo_url
||
"/img-error.png"
,
mime
:
"image/*"
,
size
:
0
,
created_at
:
logo
.
created_at
,
updated_at
:
logo
.
updated_at
,
source
:
"upload"
,
};
return
{
logo
:
{
id
:
logo
.
id
,
name
:
logo
.
logo_name
,
imageId
:
logo
.
file_id
,
isActive
:
true
,
},
media
,
};
}
function
applySiteInformationToConfig
(
baseConfig
:
BaseConfigData
,
siteInformation
:
SiteInformationData
,
):
BaseConfigData
{
const
logoConfig
=
mapSiteLogoToConfig
(
siteInformation
);
return
{
...
baseConfig
,
logo
:
logoConfig
?.
logo
??
baseConfig
.
logo
,
websiteName
:
siteInformation
.
website_name
??
baseConfig
.
websiteName
,
websiteLink
:
siteInformation
.
website_link
??
baseConfig
.
websiteLink
,
branches
:
Array
.
isArray
(
siteInformation
.
branches
)
?
siteInformation
.
branches
.
map
(
mapApiBranchToConfig
)
:
baseConfig
.
branches
,
socials
:
Array
.
isArray
(
siteInformation
.
socials
)
?
siteInformation
.
socials
.
map
(
mapApiSocialToConfig
)
:
baseConfig
.
socials
,
};
}
function
ConfigItemPreview
({
title
,
item
,
...
...
@@ -309,6 +441,7 @@ export default function AdminBaseConfigPage() {
const
[
mediaItems
,
setMediaItems
]
=
React
.
useState
<
AdminMediaItem
[]
>
([]);
const
[
currentBannerIndex
,
setCurrentBannerIndex
]
=
React
.
useState
(
0
);
const
[
currentBranchIndex
,
setCurrentBranchIndex
]
=
React
.
useState
(
0
);
const
[
currentBranchId
,
setCurrentBranchId
]
=
React
.
useState
<
string
|
null
>
(
null
);
const
[
activeTab
,
setActiveTab
]
=
React
.
useState
(
"branding"
);
const
[
itemDialogOpen
,
setItemDialogOpen
]
=
React
.
useState
(
false
);
const
[
itemDialogMode
,
setItemDialogMode
]
=
React
.
useState
<
ConfigItemMode
>
(
"logo"
);
...
...
@@ -316,7 +449,9 @@ export default function AdminBaseConfigPage() {
const
[
itemForm
,
setItemForm
]
=
React
.
useState
<
ConfigItemForm
>
(
emptyItemForm
());
const
[
imagePickerOpen
,
setImagePickerOpen
]
=
React
.
useState
(
false
);
const
[
savingItem
,
setSavingItem
]
=
React
.
useState
(
false
);
const
[
savingWebsiteInfo
,
setSavingWebsiteInfo
]
=
React
.
useState
(
false
);
const
[
savingContact
,
setSavingContact
]
=
React
.
useState
(
false
);
const
[
savingSocials
,
setSavingSocials
]
=
React
.
useState
(
false
);
const
[
deleteTarget
,
setDeleteTarget
]
=
React
.
useState
<
{
mode
:
ConfigItemMode
;
id
:
string
;
...
...
@@ -324,7 +459,43 @@ export default function AdminBaseConfigPage() {
}
|
null
>
(
null
);
React
.
useEffect
(()
=>
{
setConfig
(
readBaseConfig
());
let
mounted
=
true
;
const
baseConfig
=
readBaseConfig
();
setConfig
(
baseConfig
);
const
loadSiteInformation
=
async
()
=>
{
try
{
const
response
=
await
getSiteInformation
();
const
siteInformation
=
getEnvelopeData
<
SiteInformationData
>
(
response
);
if
(
!
mounted
||
!
siteInformation
)
return
;
const
logoConfig
=
mapSiteLogoToConfig
(
siteInformation
);
if
(
logoConfig
?.
media
)
{
const
logoMedia
=
logoConfig
.
media
;
setMediaItems
((
previous
)
=>
{
const
nextMap
=
new
Map
(
previous
.
map
((
entry
)
=>
[
entry
.
id
,
entry
]));
nextMap
.
set
(
logoMedia
.
id
,
logoMedia
);
return
Array
.
from
(
nextMap
.
values
());
});
}
setConfig
((
previous
)
=>
applySiteInformationToConfig
(
previous
??
baseConfig
,
siteInformation
),
);
}
catch
(
error
)
{
console
.
error
(
error
);
if
(
mounted
)
{
toast
.
error
(
"Không thể tải thông tin liên hệ website"
);
}
}
};
void
loadSiteInformation
();
return
()
=>
{
mounted
=
false
;
};
},
[]);
const
mediaMap
=
React
.
useMemo
(
...
...
@@ -339,10 +510,17 @@ export default function AdminBaseConfigPage() {
()
=>
(
config
?
sortBaseConfigSocials
(
config
.
socials
)
:
[]),
[
config
],
);
const
sortedBranches
=
React
.
useMemo
(
()
=>
(
config
?
sortBaseConfigBranches
(
config
.
branches
)
:
[]),
[
config
],
);
const
currentLogo
=
config
?.
logo
??
null
;
const
currentBanner
=
sortedBanners
[
currentBannerIndex
]
??
null
;
const
currentBranch
=
config
?.
branches
[
currentBranchIndex
]
??
null
;
const
currentBranch
=
(
currentBranchId
?
sortedBranches
.
find
((
branch
)
=>
branch
.
id
===
currentBranchId
)
:
null
)
??
sortedBranches
[
currentBranchIndex
]
??
null
;
const
currentLogoMedia
=
currentLogo
?
resolveMediaItem
(
mediaMap
,
currentLogo
.
imageId
)
:
null
;
const
currentBannerMedia
=
currentBanner
?
resolveMediaItem
(
mediaMap
,
currentBanner
.
imageId
)
...
...
@@ -377,7 +555,7 @@ export default function AdminBaseConfigPage() {
setItemDialogOpen
(
true
);
};
const
handleSubmitItem
=
()
=>
{
const
handleSubmitItem
=
async
()
=>
{
if
(
!
config
)
return
;
const
trimmedName
=
itemForm
.
name
.
trim
();
...
...
@@ -393,16 +571,46 @@ export default function AdminBaseConfigPage() {
setSavingItem
(
true
);
if
(
itemDialogMode
===
"logo"
)
{
const
selectedMedia
=
resolveMediaItem
(
mediaMap
,
itemForm
.
imageId
);
const
currentLogoId
=
editingItemId
||
currentLogo
?.
id
||
null
;
try
{
const
response
=
currentLogoId
?
await
putLogoId
(
currentLogoId
,
{
logo_name
:
trimmedName
,
logo_url
:
selectedMedia
?.
url
??
null
,
file_id
:
itemForm
.
imageId
,
})
:
await
postLogo
({
logo_name
:
trimmedName
,
logo_url
:
selectedMedia
?.
url
??
null
,
file_id
:
itemForm
.
imageId
,
});
const
savedLogo
=
getEnvelopeData
<
NonNullable
<
SiteInformationData
[
"logo"
]
>>
(
response
);
const
nextConfig
=
cloneBaseConfigData
(
config
);
if
(
itemDialogMode
===
"logo"
)
{
nextConfig
.
logo
=
{
id
:
editingItemId
||
currentLogo
?.
id
||
createBaseConfigItemId
(
"logo"
),
name
:
trimmedName
,
imageId
:
itemForm
.
imageId
,
id
:
savedLogo
?.
id
??
currentLogoId
??
createBaseConfigItemId
(
"logo"
),
name
:
savedLogo
?.
logo_name
??
trimmedName
,
imageId
:
savedLogo
?.
file_id
??
itemForm
.
imageId
,
isActive
:
true
,
};
}
else
{
saveConfig
(
nextConfig
);
setSavingItem
(
false
);
setItemDialogOpen
(
false
);
toast
.
success
(
"Đã lưu cấu hình logo"
);
}
catch
(
error
)
{
console
.
error
(
error
);
setSavingItem
(
false
);
toast
.
error
(
"Không thể lưu cấu hình logo"
);
}
return
;
}
const
nextConfig
=
cloneBaseConfigData
(
config
);
if
(
editingItemId
)
{
nextConfig
.
banners
=
nextConfig
.
banners
.
map
((
item
)
=>
item
.
id
===
editingItemId
...
...
@@ -427,25 +635,32 @@ export default function AdminBaseConfigPage() {
});
setCurrentBannerIndex
(
Math
.
max
(
nextConfig
.
banners
.
length
-
1
,
0
));
}
}
saveConfig
(
nextConfig
);
setSavingItem
(
false
);
setItemDialogOpen
(
false
);
toast
.
success
(
itemDialogMode
===
"logo"
false
?
"Đã lưu cấu hình logo"
:
"Đã lưu cấu hình banner"
,
);
};
const
handleDeleteItem
=
()
=>
{
const
handleDeleteItem
=
async
()
=>
{
if
(
!
config
||
!
deleteTarget
)
return
;
const
nextConfig
=
cloneBaseConfigData
(
config
);
if
(
deleteTarget
.
mode
===
"logo"
)
{
try
{
await
deleteLogoId
(
deleteTarget
.
id
);
nextConfig
.
logo
=
null
;
}
catch
(
error
)
{
console
.
error
(
error
);
toast
.
error
(
"Không thể xóa cấu hình logo"
);
setDeleteTarget
(
null
);
return
;
}
}
else
{
nextConfig
.
banners
=
nextConfig
.
banners
.
filter
((
item
)
=>
item
.
id
!==
deleteTarget
.
id
);
setCurrentBannerIndex
((
previous
)
=>
...
...
@@ -468,8 +683,8 @@ export default function AdminBaseConfigPage() {
previous
?
{
...
previous
,
branches
:
previous
.
branches
.
map
((
branch
,
index
)
=>
index
===
currentBranchIndex
?
{
...
branch
,
[
key
]:
value
}
:
branch
,
branches
:
previous
.
branches
.
map
((
branch
)
=>
branch
.
id
===
currentBranch
.
id
?
{
...
branch
,
[
key
]:
value
}
:
branch
,
),
}
:
previous
,
...
...
@@ -512,14 +727,120 @@ export default function AdminBaseConfigPage() {
toast
.
success
(
"Đã lưu danh sách chi nhánh liên hệ"
);
}
;
const handleAddBranchApi = async () =
>
{
if
(
!
config
)
return
;
setSavingContact
(
true
);
try
{
const
response
=
await
postSiteInformationBranches
({
branch_name
:
`Chi nhánh ${config.branches.length + 1}`
,
sort_order
:
config
.
branches
.
length
+
1
,
is_active
:
true
,
});
const
createdBranch
=
getEnvelopeData
<
SiteInformationBranch
>
(
response
);
const
nextBranch
=
createdBranch
?
mapApiBranchToConfig
(
createdBranch
)
:
{
id
:
createBaseConfigItemId
(
"branch"
),
branchName
:
`Chi nhánh ${config.branches.length + 1}`
,
address
:
""
,
hotline
:
""
,
email
:
""
,
fax
:
""
,
mapsEmbedUrl
:
""
,
sortOrder
:
config
.
branches
.
length
+
1
,
isVisible
:
true
,
};
const
nextConfig
=
cloneBaseConfigData
(
config
);
nextConfig
.
branches
.
push
(
nextBranch
);
setConfig
(
nextConfig
);
setCurrentBranchIndex
(
nextConfig
.
branches
.
length
-
1
);
setCurrentBranchId
(
nextBranch
.
id
);
toast
.
success
(
"Đã thêm chi nhánh mới"
);
}
catch
(
error
)
{
console
.
error
(
error
);
toast
.
error
(
"Không thể thêm chi nhánh"
);
}
finally
{
setSavingContact
(
false
);
}
}
;
const handleDeleteBranchApi = async (branchId: string) =
>
{
if
(
!
config
)
return
;
setSavingContact
(
true
);
try
{
await
deleteSiteInformationBranchesId
(
branchId
);
const
nextConfig
=
cloneBaseConfigData
(
config
);
nextConfig
.
branches
=
nextConfig
.
branches
.
filter
((
branch
)
=>
branch
.
id
!==
branchId
);
setConfig
(
nextConfig
);
setCurrentBranchIndex
((
previous
)
=>
Math
.
max
(
0
,
Math
.
min
(
previous
,
Math
.
max
(
nextConfig
.
branches
.
length
-
1
,
0
))),
);
setCurrentBranchId
(
null
);
toast
.
success
(
"Đã xóa chi nhánh"
);
}
catch
(
error
)
{
console
.
error
(
error
);
toast
.
error
(
"Không thể xóa chi nhánh"
);
}
finally
{
setSavingContact
(
false
);
}
}
;
const handleSaveBranchesApi = async () =
>
{
if
(
!
config
)
return
;
setSavingContact
(
true
);
try
{
await
Promise
.
all
(
sortBaseConfigBranches
(
config
.
branches
).
map
((
branch
,
index
)
=>
patchSiteInformationBranchesId
(
branch
.
id
,
mapConfigBranchToApi
(
branch
,
index
)),
),
);
setConfig
(
config
);
toast
.
success
(
"Đã lưu danh sách chi nhánh liên hệ"
);
}
catch
(
error
)
{
console
.
error
(
error
);
toast
.
error
(
"Không thể lưu danh sách chi nhánh"
);
}
finally
{
setSavingContact
(
false
);
}
}
;
const handleWebsiteInfoChange = (key: "websiteName" | "websiteLink", value: string) =
>
{
setConfig
((
previous
)
=>
(
previous
?
{
...
previous
,
[
key
]:
value
}
:
previous
));
}
;
const handleSaveWebsiteInfo = () =
>
{
const handleSaveWebsiteInfo =
async
() =
>
{
if
(
!
config
)
return
;
saveConfig
(
config
);
setSavingWebsiteInfo
(
true
);
try
{
const
response
=
await
putSiteInformation
({
website_name
:
config
.
websiteName
.
trim
()
||
null
,
website_link
:
config
.
websiteLink
.
trim
()
||
null
,
});
const
siteInformation
=
getEnvelopeData
<
SiteInformationData
>
(
response
);
if
(
siteInformation
)
{
setConfig
((
previous
)
=>
applySiteInformationToConfig
(
previous
??
config
,
siteInformation
),
);
}
else
{
setConfig
(
config
);
}
toast
.
success
(
"Đã lưu thông tin website"
);
}
catch
(
error
)
{
console
.
error
(
error
);
toast
.
error
(
"Không thể lưu thông tin website"
);
}
finally
{
setSavingWebsiteInfo
(
false
);
}
}
;
const handleSocialChange =
<
K
extends
keyof
BaseConfigSocialItem
>
(
...
...
@@ -545,6 +866,26 @@ export default function AdminBaseConfigPage() {
toast
.
success
(
"Đã lưu cấu hình mạng xã hội"
);
}
;
const handleSaveSocialsApi = async () =
>
{
if
(
!
config
)
return
;
setSavingSocials
(
true
);
try
{
await
Promise
.
all
(
config
.
socials
.
map
((
social
)
=>
patchSiteInformationSocialsId
(
social
.
id
,
mapConfigSocialToApi
(
social
)),
),
);
setConfig
(
config
);
toast
.
success
(
"Đã lưu cấu hình mạng xã hội"
);
}
catch
(
error
)
{
console
.
error
(
error
);
toast
.
error
(
"Không thể lưu cấu hình mạng xã hội"
);
}
finally
{
setSavingSocials
(
false
);
}
}
;
if (!config)
{
return
(
<
div
className=
"rounded-3xl border border-[#063e8e]/10 bg-white p-10 text-center text-gray-500"
>
...
...
@@ -698,10 +1039,11 @@ export default function AdminBaseConfigPage() {
<
Button
type=
"button"
onClick=
{
handleSaveWebsiteInfo
}
disabled=
{
savingWebsiteInfo
}
className=
"w-full rounded-xl bg-[#163b73] text-white hover:bg-[#163b73]/90"
>
<
Save
className=
"mr-2 h-4 w-4"
/>
Lưu thông tin website
{
savingWebsiteInfo
?
"Đang lưu..."
:
"Lưu thông tin website"
}
</
Button
>
</
div
>
)
:
(
...
...
@@ -882,7 +1224,7 @@ export default function AdminBaseConfigPage() {
<
div
className=
"flex flex-wrap gap-3"
>
<
Button
type=
"button"
onClick=
{
handleAddBranch
}
onClick=
{
handleAddBranch
Api
}
className=
"rounded-xl bg-[#063e8e] text-white hover:bg-[#063e8e]/90"
>
<
Plus
className=
"mr-2 h-4 w-4"
/>
...
...
@@ -890,7 +1232,7 @@ export default function AdminBaseConfigPage() {
</
Button
>
<
Button
type=
"button"
onClick=
{
handleSaveBranches
}
onClick=
{
handleSaveBranches
Api
}
disabled=
{
savingContact
}
className=
"rounded-xl bg-[#163b73] text-white hover:bg-[#163b73]/90"
>
...
...
@@ -907,13 +1249,16 @@ export default function AdminBaseConfigPage() {
Danh sách chi nhánh
</
div
>
<
div
className=
"space-y-3"
>
{
config
.
b
ranches
.
map
((
branch
,
index
)
=>
(
{
sortedB
ranches
.
map
((
branch
,
index
)
=>
(
<
BranchCard
key=
{
branch
.
id
}
branch=
{
branch
}
current=
{
index
===
currentBranchIndex
}
onSelect=
{
()
=>
setCurrentBranchIndex
(
index
)
}
onDelete=
{
()
=>
handleDeleteBranch
(
branch
.
id
)
}
current=
{
currentBranch
?.
id
===
branch
.
id
}
onSelect=
{
()
=>
{
setCurrentBranchIndex
(
index
);
setCurrentBranchId
(
branch
.
id
);
}
}
onDelete=
{
()
=>
handleDeleteBranchApi
(
branch
.
id
)
}
/>
))
}
</
div
>
...
...
@@ -977,6 +1322,33 @@ export default function AdminBaseConfigPage() {
/>
</
div
>
</
div
>
<
div
className=
"grid gap-5 md:grid-cols-2"
>
<
div
className=
"space-y-2"
>
<
Label
className=
"text-gray-700"
>
Thứ tự hiển thị
</
Label
>
<
Input
type=
"number"
min=
{
1
}
value=
{
currentBranch
.
sortOrder
}
onChange=
{
(
event
)
=>
handleBranchChange
(
"sortOrder"
,
Number
(
event
.
target
.
value
||
1
))
}
className=
{
fieldClassName
}
/>
</
div
>
<
div
className=
"flex items-center justify-between rounded-2xl border border-[#063e8e]/10 bg-white px-4 py-3"
>
<
div
>
<
div
className=
"text-sm font-medium text-[#163b73]"
>
Trạng thái hiển thị
</
div
>
<
div
className=
"text-xs text-gray-500"
>
{
currentBranch
.
isVisible
?
"Đang hiển thị"
:
"Đang ẩn"
}
</
div
>
</
div
>
<
Switch
checked=
{
currentBranch
.
isVisible
}
onCheckedChange=
{
(
value
)
=>
handleBranchChange
(
"isVisible"
,
value
)
}
/>
</
div
>
</
div
>
</>
)
:
(
<
div
className=
"rounded-3xl border border-dashed border-[#063e8e]/15 bg-white px-5 py-10 text-center text-sm text-gray-500"
>
...
...
@@ -1001,7 +1373,8 @@ export default function AdminBaseConfigPage() {
<
Button
type=
"button"
onClick=
{
handleSaveSocials
}
onClick=
{
handleSaveSocialsApi
}
disabled=
{
savingSocials
}
className=
"rounded-xl bg-[#163b73] text-white hover:bg-[#163b73]/90"
>
<
Save
className=
"mr-2 h-4 w-4"
/>
...
...
src/mockdata/base-config.ts
View file @
8c9baba4
...
...
@@ -29,6 +29,8 @@ export interface BaseConfigBranchItem {
email
:
string
;
fax
:
string
;
mapsEmbedUrl
:
string
;
sortOrder
:
number
;
isVisible
:
boolean
;
}
export
interface
BaseConfigSocialItem
{
...
...
@@ -56,6 +58,8 @@ export const EMPTY_BASE_CONFIG_BRANCH: BaseConfigBranchItem = {
email
:
""
,
fax
:
""
,
mapsEmbedUrl
:
""
,
sortOrder
:
1
,
isVisible
:
true
,
};
export
const
BASE_CONFIG_SOCIAL_SEED
:
BaseConfigSocialItem
[]
=
[
...
...
@@ -147,6 +151,8 @@ const BASE_CONFIG_SEED: BaseConfigData = {
email
:
"info@vccinews.vn"
,
fax
:
"028 3932 5789"
,
mapsEmbedUrl
:
"https://maps.google.com/?q=171+Vo+Thi+Sau+Quan+3+TPHCM"
,
sortOrder
:
1
,
isVisible
:
true
,
},
{
id
:
"base-branch-002"
,
...
...
@@ -156,6 +162,8 @@ const BASE_CONFIG_SEED: BaseConfigData = {
email
:
"hanoi@vccinews.vn"
,
fax
:
"024 3574 2020"
,
mapsEmbedUrl
:
"https://maps.google.com/?q=9+Dao+Duy+Anh+Dong+Da+Ha+Noi"
,
sortOrder
:
2
,
isVisible
:
true
,
},
],
};
...
...
@@ -201,6 +209,8 @@ export function readBaseConfig(): BaseConfigData {
email
:
parsed
.
contactInfo
.
email
||
""
,
fax
:
parsed
.
contactInfo
.
fax
||
""
,
mapsEmbedUrl
:
parsed
.
contactInfo
.
mapsEmbedUrl
||
""
,
sortOrder
:
1
,
isVisible
:
true
,
},
]
:
BASE_CONFIG_SEED
.
branches
;
...
...
@@ -253,13 +263,21 @@ export function readBaseConfig(): BaseConfigData {
})
:
BASE_CONFIG_SOCIAL_SEED
.
map
((
item
)
=>
({
...
item
})),
branches
:
Array
.
isArray
(
parsed
.
branches
)
?
parsed
.
branches
.
map
((
item
)
=>
({
?
parsed
.
branches
.
map
((
item
,
index
)
=>
({
...
EMPTY_BASE_CONFIG_BRANCH
,
...
item
,
fax
:
typeof
(
item
as
BaseConfigBranchItem
&
{
fax
?:
string
}).
fax
===
"string"
?
(
item
as
BaseConfigBranchItem
&
{
fax
?:
string
}).
fax
??
""
:
""
,
sortOrder
:
typeof
(
item
as
BaseConfigBranchItem
&
{
sortOrder
?:
number
}).
sortOrder
===
"number"
?
(
item
as
BaseConfigBranchItem
&
{
sortOrder
?:
number
}).
sortOrder
??
index
+
1
:
index
+
1
,
isVisible
:
typeof
(
item
as
BaseConfigBranchItem
&
{
isVisible
?:
boolean
}).
isVisible
===
"boolean"
?
(
item
as
BaseConfigBranchItem
&
{
isVisible
?:
boolean
}).
isVisible
:
true
,
}))
:
fallbackBranchFromLegacyContact
,
};
...
...
@@ -291,3 +309,10 @@ export function sortBaseConfigSocials(items: BaseConfigSocialItem[]) {
return
first
.
label
.
localeCompare
(
second
.
label
,
"vi"
);
});
}
export
function
sortBaseConfigBranches
(
items
:
BaseConfigBranchItem
[])
{
return
[...
items
].
sort
((
first
,
second
)
=>
{
if
(
first
.
sortOrder
!==
second
.
sortOrder
)
return
first
.
sortOrder
-
second
.
sortOrder
;
return
first
.
branchName
.
localeCompare
(
second
.
branchName
,
"vi"
);
});
}
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