Commit ea171371 authored by Tình Trương's avatar Tình Trương

update

parent 0c577f62
...@@ -71,4 +71,5 @@ export enum API_PATHS { ...@@ -71,4 +71,5 @@ export enum API_PATHS {
detailCustomer = 'customer/detail', detailCustomer = 'customer/detail',
updateCustomer = 'customer/update', updateCustomer = 'customer/update',
getPostCategory = 'postCategory', getPostCategory = 'postCategory',
addPost = 'post/add',
} }
...@@ -45,13 +45,13 @@ ...@@ -45,13 +45,13 @@
hide-pagination hide-pagination
class="sticky-header-table" class="sticky-header-table"
> >
<template v-slot:body-cell-STT="item"> <!-- <template v-slot:body-cell-STT="item">
<q-td style="padding: 0; height: 100%"> <q-td style="padding: 0; height: 100%">
<div align="center"> <div align="center">
{{ item.rowIndex + 1 }} {{ item.rowIndex + 1 }}
</div> </div>
</q-td> </q-td>
</template> </template> -->
<template v-slot:body-cell-action="item"> <template v-slot:body-cell-action="item">
<q-td style="padding: 0"> <q-td style="padding: 0">
<div align="center"> <div align="center">
...@@ -162,9 +162,10 @@ import { AxiosResponse } from 'axios'; ...@@ -162,9 +162,10 @@ import { AxiosResponse } from 'axios';
import { api, BaseResponseBody } from 'src/boot/axios'; import { api, BaseResponseBody } from 'src/boot/axios';
import { import {
PaginationResponse, PaginationResponse,
Post, PostType,
FileUploadType, FileUploadType,
CategoryPostType, CategoryPostType,
PostDetailType,
} from 'src/assets/type'; } from 'src/assets/type';
import { config } from 'src/assets/configurations'; import { config } from 'src/assets/configurations';
import { PostStatus } from 'src/assets/enums'; import { PostStatus } from 'src/assets/enums';
...@@ -182,14 +183,14 @@ export default defineComponent({ ...@@ -182,14 +183,14 @@ export default defineComponent({
}, },
setup() { setup() {
const postTableColumns = [ const postTableColumns = [
{ // {
name: 'STT', // name: 'STT',
field: 'STT', // field: 'STT',
required: true, // required: true,
label: 'STT', // label: 'STT',
align: 'center', // align: 'center',
sortable: false, // sortable: false,
}, // },
{ {
name: 'name', name: 'name',
field: 'name', field: 'name',
...@@ -309,7 +310,7 @@ export default defineComponent({ ...@@ -309,7 +310,7 @@ export default defineComponent({
pageSize: pageSize.value, pageSize: pageSize.value,
name: namePost.value, name: namePost.value,
}, },
})) as AxiosResponse<BaseResponseBody<PaginationResponse<Post>>>; })) as AxiosResponse<BaseResponseBody<PaginationResponse<PostType>>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) { if (response.data.error.code === config.API_RES_CODE.OK.code) {
postTableRows.value = response.data.data.data; postTableRows.value = response.data.data.data;
totalPage.value = response.data.data.totalPages; totalPage.value = response.data.data.totalPages;
...@@ -362,24 +363,25 @@ export default defineComponent({ ...@@ -362,24 +363,25 @@ export default defineComponent({
//gọi api add //gọi api add
const addNewPost = async () => { const addNewPost = async () => {
// const data = { const data = {
// name: name.value, image: image.value,
// status: status.value, status: status.value,
// }; category: category.value,
// const response = (await api({ };
// url: API_PATHS.addPost, const response = (await api({
// method: 'POST', url: API_PATHS.addPost,
// data, method: 'POST',
// })) as AxiosResponse<BaseResponseBody<[]>>; data,
// if (response.data.error.code === config.API_RES_CODE.OK.code) { })) as AxiosResponse<BaseResponseBody<PostDetailType[]>>;
// addPostDialogIsOpened.value = false; if (response.data.error.code === config.API_RES_CODE.OK.code) {
// Notify.create({ addPostDialogIsOpened.value = false;
// type: 'positive', Notify.create({
// message: i18n.global.t('post.actionMessages.addNewPostAccess'), type: 'positive',
// actions: [{ icon: 'close', color: 'white' }], message: i18n.global.t('post.actionMessages.addNewPostAccess'),
// }); actions: [{ icon: 'close', color: 'white' }],
// void getListPost(); });
// } void getListPost();
}
}; };
const openUpdatePostDialog = (id: number) => { const openUpdatePostDialog = (id: number) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment