Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
QuocAnh189 committed Oct 15, 2024
1 parent df9a440 commit a87b5f1
Show file tree
Hide file tree
Showing 43 changed files with 40 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import { IGetParam, initGetParam } from '@shared/interfaces/common/index'
//redux
import { useGetCategoriesQuery } from '@app/redux/apis/category.api'

export default function TableCategoriesTrash() {
export default function TableCategories() {
const router = useRouter()

const [filter, setFilter] = useState<IGetParam>(initGetParam)
const { data, isSuccess } = useGetCategoriesQuery<any>(filter)
const { data, isSuccess } = useGetCategoriesQuery(filter)

const [confirmDelete, setConfirmDelete] = useState<boolean>(false)
const [currentCategory, setCurrentCategory] = useState<ICategory | null>(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import CheckboxTable from '@widgets/input/CheckboxTable'
//interface
import { ICategory } from '@entities/category'

export default function TableCustomer() {
export default function TableCustomerList() {
const router = useRouter()

const [confirmDelete, setConfirmDelete] = useState<boolean>(false)
Expand Down Expand Up @@ -54,9 +54,7 @@ export default function TableCustomer() {

const handleSelectOne = (id: string) => {
setSelectedCustomers((prevSelected) =>
prevSelected.includes(id)
? prevSelected.filter((selectedId: string) => selectedId !== id)
: [...prevSelected, id]
prevSelected.includes(id) ? prevSelected.filter((selectedId: string) => selectedId !== id) : [...prevSelected, id]
)
}

Expand Down Expand Up @@ -84,9 +82,7 @@ export default function TableCustomer() {
header={
<CheckboxTable
checked={selectedCustomers.length === rowsNumber}
handleClick={(e: React.ChangeEvent<HTMLInputElement>) =>
handleSelectAll(e)
}
handleClick={(e: React.ChangeEvent<HTMLInputElement>) => handleSelectAll(e)}
/>
}
body={(rowData) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import CheckboxTable from '@widgets/input/CheckboxTable'
//interface
import { ICategory } from '@entities/category'

export default function TableCustomerTrash() {
export default function TableCustomerListTrash() {
const router = useRouter()

const [confirmDelete, setConfirmDelete] = useState<boolean>(false)
Expand Down Expand Up @@ -54,9 +54,7 @@ export default function TableCustomerTrash() {

const handleSelectOne = (id: string) => {
setSelectedCustomers((prevSelected) =>
prevSelected.includes(id)
? prevSelected.filter((selectedId: string) => selectedId !== id)
: [...prevSelected, id]
prevSelected.includes(id) ? prevSelected.filter((selectedId: string) => selectedId !== id) : [...prevSelected, id]
)
}

Expand Down Expand Up @@ -84,9 +82,7 @@ export default function TableCustomerTrash() {
header={
<CheckboxTable
checked={selectedCustomers.length === rowsNumber}
handleClick={(e: React.ChangeEvent<HTMLInputElement>) =>
handleSelectAll(e)
}
handleClick={(e: React.ChangeEvent<HTMLInputElement>) => handleSelectAll(e)}
/>
}
body={(rowData) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import CheckboxTable from '@widgets/input/CheckboxTable'
//interface
import { IEvent } from '@entities/event'

export default function TableEvent() {
export default function TableEvents() {
const router = useRouter()

const [confirmDelete, setConfirmDelete] = useState<boolean>(false)
Expand Down Expand Up @@ -54,9 +54,7 @@ export default function TableEvent() {

const handleSelectOne = (id: string) => {
setSelectedEvents((prevSelected) =>
prevSelected.includes(id)
? prevSelected.filter((selectedId: string) => selectedId !== id)
: [...prevSelected, id]
prevSelected.includes(id) ? prevSelected.filter((selectedId: string) => selectedId !== id) : [...prevSelected, id]
)
}

Expand Down Expand Up @@ -90,9 +88,7 @@ export default function TableEvent() {
header={
<CheckboxTable
checked={selectedEvents.length === rowsNumber}
handleClick={(e: React.ChangeEvent<HTMLInputElement>) =>
handleSelectAll(e)
}
handleClick={(e: React.ChangeEvent<HTMLInputElement>) => handleSelectAll(e)}
/>
}
body={(rowData) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ export default function TableOrdersCancel() {

const handleSelectOne = (id: string) => {
setSelectedOrders((prevSelected) =>
prevSelected.includes(id)
? prevSelected.filter((selectedId: string) => selectedId !== id)
: [...prevSelected, id]
prevSelected.includes(id) ? prevSelected.filter((selectedId: string) => selectedId !== id) : [...prevSelected, id]
)
}

Expand Down Expand Up @@ -77,9 +75,7 @@ export default function TableOrdersCancel() {
header={
<CheckboxTable
checked={selectedOrders.length === rowsNumber}
handleClick={(e: React.ChangeEvent<HTMLInputElement>) =>
handleSelectAll(e)
}
handleClick={(e: React.ChangeEvent<HTMLInputElement>) => handleSelectAll(e)}
/>
}
body={(rowData) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import CheckboxTable from '@widgets/input/CheckboxTable'
//interface
import { IReview } from '@entities/review'

export default function TableReview() {
export default function TableReviews() {
const router = useRouter()

const [confirmDelete, setConfirmDelete] = useState<boolean>(false)
Expand Down Expand Up @@ -54,9 +54,7 @@ export default function TableReview() {

const handleSelectOne = (id: string) => {
setSelectedReviews((prevSelected) =>
prevSelected.includes(id)
? prevSelected.filter((selectedId: string) => selectedId !== id)
: [...prevSelected, id]
prevSelected.includes(id) ? prevSelected.filter((selectedId: string) => selectedId !== id) : [...prevSelected, id]
)
}

Expand Down Expand Up @@ -90,9 +88,7 @@ export default function TableReview() {
header={
<CheckboxTable
checked={selectedReviews.length === rowsNumber}
handleClick={(e: React.ChangeEvent<HTMLInputElement>) =>
handleSelectAll(e)
}
handleClick={(e: React.ChangeEvent<HTMLInputElement>) => handleSelectAll(e)}
/>
}
body={(rowData) => (
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/features/form/category.form/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client'
import React, { FC, use, useEffect } from 'react'
import React, { FC, useEffect } from 'react'

//next
import Image from 'next/image'
Expand Down
4 changes: 2 additions & 2 deletions src/pages/admin-list.page/admin-list.trash.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableAdminTrash from './ui/TableAdminListTrash'
import TableAdminListTrash from '@features/datatable/admin/TableAdminListTrash'

const AdminListTrashPage = () => {
return (
<MainLayout>
<TableAdminTrash />
<TableAdminListTrash />
</MainLayout>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/admin-list.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableAdmin from './ui/TableAdminList'
import TableAdminList from '@features/datatable/admin/TableAdminList'

const AdminListPage = () => {
return (
<MainLayout>
<TableAdmin />
<TableAdminList />
</MainLayout>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableOrdersCancelTrash from './ui/TableOrdersCancelTrash'
import TableTransactionsTrash from '@features/datatable/transaction/TableTransactionsTrash'

const CancelOrdersTrashPage = () => {
return (
<MainLayout>
<TableOrdersCancelTrash />
<TableTransactionsTrash />
</MainLayout>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/all-cancel-orders.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableOrdersCancel from './ui/TableOrdersCancel'
import TableOrdersCancel from '@features/datatable/order/TableOrdersCancel'

const AllCancelOrdersPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/all-orders.page/all-orders.trash.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableAllOrdersTrash from './ui/TableAllOrdersTrash'
import TableAllOrdersTrash from '@features/datatable/order/TableAllOrdersTrash'

const AllOrdersTrashPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/all-orders.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableAllOrders from './ui/TableAllOrders'
import TableAllOrders from '@features/datatable/order/TableAllOrders'

const AllOrdersPage = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableOrdersPendingTrash from './ui/TableOrdersPendingTrash'
import TableOrdersPendingTrash from '@features/datatable/order/TableOrdersPendingTrash'

const PendingOrdersTrashPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/all-pending-orders.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableOrdersPending from './ui/TableOrdersPending'
import TableOrdersPending from '@features/datatable/order/TableOrdersPending'

const PendingOrdersPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/categories.page/category.trash.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableCategoriesTrash from './ui/TableCategoriesTrash'
import TableCategoriesTrash from '@features/datatable/category/TableCategoriesTrash'

const CategoriesTrashPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/categories.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableCategories from './ui/TableCategories'
import TableCategories from '@features/datatable/category/TableCategories'

const CategoriesPage = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableCustomerListTrash from './ui/TableCustomerListTrash'
import TableCustomerListTrash from '@features/datatable/customer/TableCustomerListTrash'

const CustomerListTrashPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/customer-list.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableCustomerList from './ui/TableCustomerList'
import TableCustomerList from '@features/datatable/customer/TableCustomerList'

const CustomerListPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/events.page/event.trash.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableEventsTrash from './ui/EventsTrash'
import TableEventsTrash from '@features/datatable/event/EventsTrash'

const EventsTrashPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/events.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableEvents from './ui/TableEvents'
import TableEvents from '@features/datatable/event/TableEvents'

const EventsPage = () => {
return (
Expand Down
15 changes: 0 additions & 15 deletions src/pages/products.page/index.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions src/pages/products.page/ui/EventPage.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/reviews.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableReviews from './ui/TableReviews'
import TableReviews from '@features/datatable/review/TableReviews'

const ReviewPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/reviews.page/reviews.trash.tsx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableReviewsTrash from './ui/TableReviewsTrash'
import TableReviewsTrash from '@features/datatable/review/TableReviewsTrash'

const ReviewsTrashPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tickets.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableTicket from './ui/TableTickets'
import TableTicket from '@features/datatable/ticket/TableTickets'

const TicketPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tickets.page/tickets.trash.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableTicketsTrash from './ui/TableTicketsTrash'
import TableTicketsTrash from '@features/datatable/ticket/TableTicketsTrash'

const TicketsTrashPage = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/transactions.page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableTransactions from './ui/TableTransactions'
import TableTransactions from '@features/datatable/transaction/TableTransactions'

const TransactionsPage = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MainLayout from '@shared/ui/layouts/MainLayout'

//components
import TableTransactionsTrash from './ui/TableTransactionsTrash'
import TableTransactionsTrash from '@features/datatable/transaction/TableTransactionsTrash'

const TransactionsTrashPage = () => {
return (
Expand Down

0 comments on commit a87b5f1

Please sign in to comment.