refactor: sort product is add

This commit is contained in:
Thanaphon Frappet 2024-11-29 15:10:25 +07:00
parent 0d72c5eee6
commit e7eb53dd57
3 changed files with 29 additions and 2 deletions

View file

@ -581,7 +581,10 @@ async function fetchListGroups() {
}
}
async function fetchListOfProductIsAdd(productGroupId: string) {
async function fetchListOfProductIsAdd(
productGroupId: string,
isSort?: boolean,
) {
const res = await fetchListProduct({
status:
currentStatus.value === 'INACTIVE'
@ -592,6 +595,8 @@ async function fetchListOfProductIsAdd(productGroupId: string) {
productGroupId,
shared: true,
pageSize: 150,
orderField: 'name',
orderBy: true ? 'asc' : 'desc',
});
if (res) {
@ -3496,6 +3501,11 @@ watch(
:fieldSelected="tbControl.product.fieldSelected"
:grid="modeViewIsAdd"
v-model:selectedItem="selectProduct"
@sort="
(isSort) => {
fetchListOfProductIsAdd(currentIdGroup, isSort);
}
"
@select="
(data) => {
{