Skip to content

Commit

Permalink
Merge pull request #28 from amansinghbais/27-login-component
Browse files Browse the repository at this point in the history
Improved: baseUrl for login, fetching userProfile and availableTimeZones using the admin component (#27)
  • Loading branch information
ravilodhi authored Jun 25, 2024
2 parents 4cd06e7 + 9133dce commit 53d1994
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"Configure when no further order information is needed prior to order approval.": "Configure when no further order information is needed prior to order approval.",
"Confirm": "Confirm",
"Control what your customers are allowed to edit on their own when they are editing their order on Re-route Fulfillment.": "Control what your customers are allowed to edit on their own when they are editing their order on Re-route Fulfillment.",
"Country": "{count} country",
"country": "{count} country",
"countries": "{count} countries",
"Create a new product store": "Create a new product store",
"Create deadline days": "Create deadline days",
Expand Down
6 changes: 3 additions & 3 deletions src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { hasError } from "@/utils";

const login = async (token: string): Promise <any> => {
const url = store.getters["user/getBaseUrl"]
const baseURL = url.startsWith('http') ? url.includes('/rest/s1/admin') ? url.replace("admin", "available-to-promise") : `${url}/rest/s1/available-to-promise/` : `https://${url}.hotwax.io/rest/s1/available-to-promise/`;
const baseURL = url.startsWith('http') ? url.includes('/rest/s1/admin') ? url : `${url}/rest/s1/admin/` : `https://${url}.hotwax.io/rest/s1/admin/`;
let api_key = ""

try {
Expand Down Expand Up @@ -33,7 +33,7 @@ const login = async (token: string): Promise <any> => {

const getUserProfile = async (token: any): Promise<any> => {
const url = store.getters["user/getBaseUrl"]
const baseURL = url.startsWith('http') ? url.includes('/rest/s1/admin') ? url.replace("admin", "available-to-promise") : `${url}/rest/s1/available-to-promise/` : `https://${url}.hotwax.io/rest/s1/available-to-promise/`;
const baseURL = url.startsWith('http') ? url.includes('/rest/s1/admin') ? url : `${url}/rest/s1/admin/` : `https://${url}.hotwax.io/rest/s1/admin/`;
try {
const resp = await client({
url: "user/profile",
Expand All @@ -53,7 +53,7 @@ const getUserProfile = async (token: any): Promise<any> => {

const getAvailableTimeZones = async (): Promise <any> => {
const url = store.getters["user/getBaseUrl"]
const baseURL = url.startsWith('http') ? url.includes('/rest/s1/admin') ? url.replace("admin", "available-to-promise") : `${url}/rest/s1/available-to-promise/` : `https://${url}.hotwax.io/rest/s1/available-to-promise/`;
const baseURL = url.startsWith('http') ? url.includes('/rest/s1/admin') ? url : `${url}/rest/s1/admin/` : `https://${url}.hotwax.io/rest/s1/admin/`;
return client({
url: "user/getAvailableTimeZones",
method: "get",
Expand Down

0 comments on commit 53d1994

Please sign in to comment.