Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved: support for adding picker role to _NA_ party and fixed issue in assignPicker modal (#428) #429

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,17 @@ const isEnumExists = async (enumId: string): Promise<any> => {
}
}

const ensurePartyRole = async (payload: any): Promise <any> => {
return api({
url: "service/ensurePartyRole",
method: "post",
data: payload
});
}

export const UserService = {
createEnumeration,
ensurePartyRole,
login,
getCurrentEComStore,
getRerouteFulfillmentConfig,
Expand Down
19 changes: 17 additions & 2 deletions src/views/Orders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ import { api, hasError } from '@/adapter';
import { translate } from "@hotwax/dxp-components";
import AssignPickerModal from "./AssignPickerModal.vue";
import { OrderService } from "@/services/OrderService";
import { UserService } from "@/services/UserService";
import { Actions, hasPermission } from '@/authorization'
import logger from "@/logger";

Expand Down Expand Up @@ -276,7 +277,7 @@ export default defineComponent({
});

assignPickerModal.onDidDismiss().then(async(result: any) => {
if(result.data?.dismissed) {
if(result.data?.selectedPicker) {
await this.store.dispatch('order/packShipGroupItems', { order, part, facilityId, selectedPicker: result.data.selectedPicker })
}
})
Expand Down Expand Up @@ -516,6 +517,20 @@ export default defineComponent({
}

if(!this.configurePicker) {
try {
const resp = await UserService.ensurePartyRole({
partyId: "_NA_",
roleTypeId: "WAREHOUSE_PICKER",
})

if(hasError(resp)) {
throw resp.data;
}
} catch (error) {
showToast(translate("Something went wrong. Picklist can not be created."));
logger.error(error)
return;
}
await this.createPicklist(order, "_NA_");
return;
}
Expand All @@ -526,7 +541,7 @@ export default defineComponent({
});

assignPickerModal.onDidDismiss().then(async(result: any) => {
if(result.data?.dismissed) {
if(result.data?.selectedPicker) {
this.createPicklist(order, result.data.selectedPicker)
}
})
Expand Down
Loading