orderiom-api-package 0.4.94 → 0.4.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/common.js
CHANGED
|
@@ -149,13 +149,17 @@ const getAuthToken = async ($store, hadPrivateToken = false) => {
|
|
|
149
149
|
|
|
150
150
|
if(hadPrivateToken) {
|
|
151
151
|
$store.commit("auth/clearAuthData");
|
|
152
|
-
await $store.dispatch('unassignBasket');
|
|
152
|
+
await $store.dispatch('auth/unassignBasket');
|
|
153
153
|
}
|
|
154
154
|
} catch (error) {
|
|
155
155
|
return commonErrorCallback()(error)
|
|
156
156
|
} finally {
|
|
157
157
|
while (reqBuffer.length) {
|
|
158
|
-
|
|
158
|
+
let basketId = null;
|
|
159
|
+
if(hadPrivateToken){
|
|
160
|
+
basketId = calculateBasketIdParameter(false, restaurantIdEnv())
|
|
161
|
+
}
|
|
162
|
+
reqBuffer.shift()(basketId); // First in First out
|
|
159
163
|
}
|
|
160
164
|
isFetchingToken = false;
|
|
161
165
|
}
|
|
@@ -190,10 +194,19 @@ export const defineInterceptors = ({$store}) => {
|
|
|
190
194
|
localStorage.removeItem("publicToken");
|
|
191
195
|
|
|
192
196
|
// Push the request to waitlist and wait for new token to be fetched
|
|
193
|
-
reqBuffer.push(() => {
|
|
197
|
+
reqBuffer.push((basketId = null) => {
|
|
194
198
|
const newToken = localStorage.getItem("publicToken");
|
|
195
199
|
if(newToken){
|
|
196
200
|
config.headers["Authorization"] = `Bearer ${newToken}`
|
|
201
|
+
|
|
202
|
+
// basketId is available only when unassign-basket is called right before resolving the request from waitlist
|
|
203
|
+
if(basketId){
|
|
204
|
+
const key = config.method === 'get' ? 'params' : 'data';
|
|
205
|
+
const data = config[key] || {};
|
|
206
|
+
if(!data.basketId) data.basketId = basketId;
|
|
207
|
+
config[key] = data;
|
|
208
|
+
}
|
|
209
|
+
|
|
197
210
|
resolve(config);
|
|
198
211
|
} else {
|
|
199
212
|
config.headers["Authorization"] = undefined;
|
package/src/messages/ar-api.json
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"id_is_required": "يرجى اختيار المعرف.",
|
|
25
25
|
"id_should_be_numeric": "يجب أن يكون المعرف رقميًا.",
|
|
26
26
|
"email_is_required": "يرجى إدخال البريد الإلكتروني.",
|
|
27
|
+
"phone_is_required": "الرجاء إدخال رقم هاتفك المحمول.",
|
|
28
|
+
"birth_date_is_required": "الرجاء إدخال تاريخ ميلادك.",
|
|
27
29
|
"email_should_be_valid": "يجب أن يكون البريد الإلكتروني صالحًا.",
|
|
28
30
|
"text_is_required": "يرجى إدخال النص.",
|
|
29
31
|
"name_is_required": "يرجى إدخال الاسم.",
|
package/src/messages/de-api.json
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"id_is_required": "Bitte wählen Sie Ihre ID.",
|
|
25
25
|
"id_should_be_numeric": "Ihre ID muss eine Nummer sein",
|
|
26
26
|
"email_is_required": "Bitte geben Sie Ihre E-Mail-Adresse ein.",
|
|
27
|
+
"phone_is_required": "Bitte geben Sie Ihre Mobiltelefon ein.",
|
|
28
|
+
"birth_date_is_required": "Bitte geben Sie Ihr Geburtsdatum ein.",
|
|
27
29
|
"email_should_be_valid": "Die E-Mail muss eine gültige E-Mail-Adresse sein.",
|
|
28
30
|
"text_is_required": "Bitte geben Sie Ihren Text ein.",
|
|
29
31
|
"name_is_required": "Bitte geben Sie Ihren Namen ein.",
|
package/src/messages/en-api.json
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"id_is_required": "Please select your id.",
|
|
25
25
|
"id_should_be_numeric": "Your id must be a number",
|
|
26
26
|
"email_is_required": "Please insert your email.",
|
|
27
|
+
"phone_is_required": "Please enter your mobile number.",
|
|
28
|
+
"birth_date_is_required": "Please enter your birth date.",
|
|
27
29
|
"email_should_be_valid": "The email must be a valid email address.",
|
|
28
30
|
"text_is_required": "Please insert your text.",
|
|
29
31
|
"name_is_required": "Please insert your name.",
|
package/src/messages/fr-api.json
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"id_is_required": "Veuillez sélectionner votre identifiant.",
|
|
25
25
|
"id_should_be_numeric": "Votre identifiant doit être un nombre",
|
|
26
26
|
"email_is_required": "Veuillez insérer votre email.",
|
|
27
|
+
"phone_is_required": "Veuillez saisir votre numéro de téléphone portable.",
|
|
28
|
+
"birth_date_is_required": "Veuillez saisir votre date de naissance.",
|
|
27
29
|
"email_should_be_valid": "L'email doit être une adresse email valide.",
|
|
28
30
|
"text_is_required": "Veuillez insérer votre texte.",
|
|
29
31
|
"name_is_required": "Veuillez insérer votre nom.",
|
package/src/modules/order.js
CHANGED
|
@@ -651,9 +651,10 @@ const actions = {
|
|
|
651
651
|
delete validation.name;
|
|
652
652
|
delete validation.validTime;
|
|
653
653
|
|
|
654
|
+
const messages = Object.values(validation);
|
|
654
655
|
return {
|
|
655
656
|
type: 'error',
|
|
656
|
-
msg:
|
|
657
|
+
msg: messages.length ? messages[0][0] : '',
|
|
657
658
|
name,
|
|
658
659
|
validTime,
|
|
659
660
|
inStock
|
|
@@ -879,9 +880,10 @@ const actions = {
|
|
|
879
880
|
delete validation.name;
|
|
880
881
|
delete validation.validTime;
|
|
881
882
|
|
|
883
|
+
const messages = Object.values(validation);
|
|
882
884
|
return {
|
|
883
885
|
type: 'error',
|
|
884
|
-
msg:
|
|
886
|
+
msg: messages.length ? messages[0][0] : '',
|
|
885
887
|
name,
|
|
886
888
|
validTime,
|
|
887
889
|
inStock
|