Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee9a3a2

Browse files
committed
chore: pos fetch remainder refactor
1 parent 3bf532a commit ee9a3a2

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

packages/plugin-posclient-api/src/graphql/resolvers/mutations/configs.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ const configMutations = {
226226
},
227227

228228
refetchRemainder: async (_root, { categoryId, searchValue }: { categoryId?: string, searchValue?: string }, { models, subdomain, config }: IContext) => {
229-
const { token } = config;
229+
const { token, saveRemainder } = config;
230+
if (!saveRemainder) {
231+
return 'needless'
232+
}
233+
230234
const $and: any[] = [{}];
231235

232236
const filter: any = {

pos/modules/auth/graphql/queries.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const currentConfig = gql`
5757
hasCopy
5858
hasSumQty
5959
}
60+
saveRemainder
6061
}
6162
}
6263
`

pos/modules/settings/components/Grid.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import ErxesLink from "./ErxesLink"
1111
import FetchRemainders from "../FetchRemainders"
1212

1313
const Grid = () => {
14-
const { branchId, departmentId, ebarimtConfig } =
14+
const { branchId, departmentId, ebarimtConfig, saveRemainder } =
1515
useAtomValue(configAtom) || {}
1616

1717
return (
@@ -21,7 +21,7 @@ const Grid = () => {
2121
<SyncConfig configType="products">Resync Products</SyncConfig>
2222
<SyncConfig configType="slots">Resync slots</SyncConfig>
2323
<SyncOrders />
24-
<FetchRemainders />
24+
{saveRemainder && <FetchRemainders />}
2525
<DeleteOrders />
2626

2727
{!!ebarimtConfig && <SendData />}

pos/types/config.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface IConfig {
4242
ebarimtConfig?: IEbarimtConfig
4343
branchId: string
4444
departmentId: string
45+
saveRemainder: boolean
4546
}
4647

4748
export interface IEbarimtConfig {

0 commit comments

Comments
 (0)