added translations for fn message
This commit is contained in:
parent
6be8785cd1
commit
8141d05858
|
|
@ -1,4 +1,5 @@
|
|||
import { useAuthStore, useAlertStore } from "@/stores";
|
||||
import i18nn from "@/i18n";
|
||||
|
||||
export const fetchWrapper = {
|
||||
get: request("GET"),
|
||||
|
|
@ -8,16 +9,15 @@ export const fetchWrapper = {
|
|||
};
|
||||
|
||||
function request(method) {
|
||||
console.log("INT STATUS: ", navigator.onLine);
|
||||
|
||||
if (!navigator.onLine) {
|
||||
const alertStore = useAlertStore();
|
||||
alertStore.error("Please check your internet connection");
|
||||
return Promise.reject("connection error");
|
||||
}
|
||||
|
||||
return (url, body, isFormData = false) => {
|
||||
console.log("url: " + url, "body: ", body, "isFormData: ", isFormData);
|
||||
// check internet connection
|
||||
if (!navigator.onLine) {
|
||||
console.log("in if: ", i18nn);
|
||||
const alertStore = useAlertStore();
|
||||
alertStore.error(i18nn.global.t("INT_CONN_ERROR"));
|
||||
return Promise.reject("internet connection error");
|
||||
}
|
||||
|
||||
const requestOptions = {
|
||||
method,
|
||||
headers: authHeader(url),
|
||||
|
|
|
|||
|
|
@ -108,4 +108,6 @@ export const locale = {
|
|||
|
||||
UPDATE: "Update",
|
||||
UPDATE_PWD: "Update password",
|
||||
|
||||
INT_CONN_ERROR: "Please connect to internet and try again!",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -108,4 +108,6 @@ export const locale = {
|
|||
|
||||
UPDATE: "Update",
|
||||
UPDATE_PWD: "Update password",
|
||||
|
||||
INT_CONN_ERROR: "Пожалуйста, подключитесь к Интернету и повторите попытку!",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -108,4 +108,6 @@ export const locale = {
|
|||
|
||||
UPDATE: "Update",
|
||||
UPDATE_PWD: "Update password",
|
||||
|
||||
INT_CONN_ERROR: "Internete birigip, gaýtadan synanyşmagyňyzy haýyş edýäris!",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -272,6 +272,8 @@ const onRegister = async () => {
|
|||
try {
|
||||
isLoading.value = true;
|
||||
|
||||
console.log('form data validation success');
|
||||
|
||||
const response = await fetchWrapper.put(
|
||||
`${baseUrl}/account/profile`,
|
||||
formData
|
||||
|
|
|
|||
Loading…
Reference in New Issue