mirror of https://github.com/halo-dev/halo
perf: update the api client of singlePage
parent
d49bcf1bde
commit
96b7d101d8
|
@ -33,7 +33,7 @@
|
|||
"@formkit/themes": "1.0.0-beta.10",
|
||||
"@formkit/vue": "1.0.0-beta.10",
|
||||
"@halo-dev/admin-shared": "workspace:*",
|
||||
"@halo-dev/api-client": "^0.0.18",
|
||||
"@halo-dev/api-client": "^0.0.19",
|
||||
"@halo-dev/components": "workspace:*",
|
||||
"@halo-dev/richtext-editor": "^0.0.0-alpha.6",
|
||||
"@tiptap/extension-character-count": "2.0.0-beta.31",
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
"homepage": "https://github.com/halo-dev/halo-admin/tree/next/shared/components#readme",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@halo-dev/api-client": "^0.0.18",
|
||||
"@halo-dev/api-client": "^0.0.19",
|
||||
"@halo-dev/components": "workspace:*",
|
||||
"axios": "^0.27.2",
|
||||
"lodash.merge": "^4.6.2"
|
||||
|
|
|
@ -2,6 +2,7 @@ import {
|
|||
ApiHaloRunV1alpha1ContentApi,
|
||||
ApiHaloRunV1alpha1PluginApi,
|
||||
ApiHaloRunV1alpha1PostApi,
|
||||
ApiHaloRunV1alpha1SinglePageApi,
|
||||
ApiHaloRunV1alpha1ThemeApi,
|
||||
ApiHaloRunV1alpha1UserApi,
|
||||
ContentHaloRunV1alpha1CategoryApi,
|
||||
|
@ -109,6 +110,7 @@ function setupApiClient(axios: AxiosInstance) {
|
|||
plugin: new ApiHaloRunV1alpha1PluginApi(undefined, apiUrl, axios),
|
||||
theme: new ApiHaloRunV1alpha1ThemeApi(undefined, apiUrl, axios),
|
||||
post: new ApiHaloRunV1alpha1PostApi(undefined, apiUrl, axios),
|
||||
singlePage: new ApiHaloRunV1alpha1SinglePageApi(undefined, apiUrl, axios),
|
||||
content: new ApiHaloRunV1alpha1ContentApi(undefined, apiUrl, axios),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ importers:
|
|||
'@formkit/themes': 1.0.0-beta.10
|
||||
'@formkit/vue': 1.0.0-beta.10
|
||||
'@halo-dev/admin-shared': workspace:*
|
||||
'@halo-dev/api-client': ^0.0.18
|
||||
'@halo-dev/api-client': ^0.0.19
|
||||
'@halo-dev/components': workspace:*
|
||||
'@halo-dev/richtext-editor': ^0.0.0-alpha.6
|
||||
'@iconify-json/vscode-icons': ^1.1.11
|
||||
|
@ -92,7 +92,7 @@ importers:
|
|||
'@formkit/themes': 1.0.0-beta.10_tailwindcss@3.1.8
|
||||
'@formkit/vue': 1.0.0-beta.10_wwmyxdjqen5bmh3tr2meig5lki
|
||||
'@halo-dev/admin-shared': link:packages/shared
|
||||
'@halo-dev/api-client': 0.0.18
|
||||
'@halo-dev/api-client': 0.0.19
|
||||
'@halo-dev/components': link:packages/components
|
||||
'@halo-dev/richtext-editor': 0.0.0-alpha.6_vue@3.2.37
|
||||
'@tiptap/extension-character-count': 2.0.0-beta.31
|
||||
|
@ -194,14 +194,14 @@ importers:
|
|||
|
||||
packages/shared:
|
||||
specifiers:
|
||||
'@halo-dev/api-client': ^0.0.18
|
||||
'@halo-dev/api-client': ^0.0.19
|
||||
'@halo-dev/components': workspace:*
|
||||
'@types/lodash.merge': ^4.6.7
|
||||
axios: ^0.27.2
|
||||
lodash.merge: ^4.6.2
|
||||
vite-plugin-dts: ^1.4.1
|
||||
dependencies:
|
||||
'@halo-dev/api-client': 0.0.18
|
||||
'@halo-dev/api-client': 0.0.19
|
||||
'@halo-dev/components': link:../components
|
||||
axios: 0.27.2
|
||||
lodash.merge: 4.6.2
|
||||
|
@ -2129,8 +2129,8 @@ packages:
|
|||
- windicss
|
||||
dev: false
|
||||
|
||||
/@halo-dev/api-client/0.0.18:
|
||||
resolution: {integrity: sha512-khc0ujB/fTyDnIvqqzTWeZOLz3R/SiaqsmM5h1JS7W9C6UxPgDLW2cDz450A5fOqc0i6BFbtiQ91gicqEWMXuA==}
|
||||
/@halo-dev/api-client/0.0.19:
|
||||
resolution: {integrity: sha512-5+tVk0BFeLXpqw5+yVl5b3CV0S0jjenA8/0Co8QdiQjspWmef1kXGzKpRKDBTqASTs6AOJk3cqSVoDrsVKftRg==}
|
||||
dev: false
|
||||
|
||||
/@halo-dev/richtext-editor/0.0.0-alpha.6_vue@3.2.37:
|
||||
|
|
|
@ -109,13 +109,13 @@ const handleSave = async () => {
|
|||
}
|
||||
|
||||
if (isUpdateMode.value) {
|
||||
const { data } = await apiClient.post.updateDraftSinglePage({
|
||||
const { data } = await apiClient.singlePage.updateDraftSinglePage({
|
||||
name: formState.value.page.metadata.name,
|
||||
singlePageRequest: formState.value,
|
||||
});
|
||||
formState.value.page = data;
|
||||
} else {
|
||||
const { data } = await apiClient.post.draftSinglePage({
|
||||
const { data } = await apiClient.singlePage.draftSinglePage({
|
||||
singlePageRequest: formState.value,
|
||||
});
|
||||
formState.value.page = data;
|
||||
|
|
|
@ -57,7 +57,7 @@ const checkAll = ref(false);
|
|||
const handleFetchSinglePages = async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
const { data } = await apiClient.post.listSinglePages({
|
||||
const { data } = await apiClient.singlePage.listSinglePages({
|
||||
page: singlePages.value.page,
|
||||
size: singlePages.value.size,
|
||||
});
|
||||
|
|
|
@ -82,14 +82,14 @@ const handleSave = async () => {
|
|||
formState.value.content.content = formState.value.content.raw;
|
||||
|
||||
if (isUpdateMode.value) {
|
||||
const { data } = await apiClient.post.updateDraftSinglePage({
|
||||
const { data } = await apiClient.singlePage.updateDraftSinglePage({
|
||||
name: formState.value.page.metadata.name,
|
||||
singlePageRequest: formState.value,
|
||||
});
|
||||
formState.value.page = data;
|
||||
emit("saved", formState.value);
|
||||
} else {
|
||||
const { data } = await apiClient.post.draftSinglePage({
|
||||
const { data } = await apiClient.singlePage.draftSinglePage({
|
||||
singlePageRequest: formState.value,
|
||||
});
|
||||
formState.value.page = data;
|
||||
|
@ -117,7 +117,7 @@ const handlePublish = async () => {
|
|||
formState.value.page = latestData;
|
||||
|
||||
// Publish single page
|
||||
const { data } = await apiClient.post.publishSinglePage({
|
||||
const { data } = await apiClient.singlePage.publishSinglePage({
|
||||
name: formState.value.page.metadata.name,
|
||||
});
|
||||
formState.value.page = data;
|
||||
|
@ -136,7 +136,7 @@ const handleCancelPublish = async () => {
|
|||
// Update published spec = false
|
||||
const singlePageToUpdate = cloneDeep(formState.value);
|
||||
singlePageToUpdate.page.spec.published = false;
|
||||
await apiClient.post.updateDraftSinglePage({
|
||||
await apiClient.singlePage.updateDraftSinglePage({
|
||||
name: singlePageToUpdate.page.metadata.name,
|
||||
singlePageRequest: singlePageToUpdate,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue