@@ -9,34 +9,7 @@ export default defineComponent({ | |||||
<template> | <template> | ||||
<div class="page-wrapper" id="app" data-layout="horizontal" data-navbarbg="skin6" data-sidebartype="full" data-sidebar-position="fixed" data-header-position="fixed"> | <div class="page-wrapper" id="app" data-layout="horizontal" data-navbarbg="skin6" data-sidebartype="full" data-sidebar-position="fixed" data-header-position="fixed"> | ||||
<!-- Header Start --> | <!-- Header Start --> | ||||
<header class="app-header"> | |||||
<nav class="navbar navbar-expand-lg navbar-light container-fluid px-0"> | |||||
<ul class="navbar-nav"> | |||||
<li class="nav-item d-block d-lg-none"> | |||||
<a class="nav-link sidebartoggler ms-n3" id="sidebarCollapse" href="javascript:void(0)"> | |||||
<i class="ti ti-menu-2"></i> | |||||
</a> | |||||
</li> | |||||
<li class="nav-item d-none d-lg-block"> | |||||
<a href="index.html" class="text-nowrap nav-link"> | |||||
<img src="../public/sensofarm.svg" class="light-logo" width="180" alt="" /> | |||||
</a> | |||||
</li> | |||||
</ul> | |||||
<ul class="navbar-nav quick-links d-none d-xl-flex"> | |||||
<li class="nav-item dropdown-hover d-none d-xl-block"> | |||||
<a class="nav-link" href="">Home</a> | |||||
</li> | |||||
<li class="nav-item dropdown-hover d-none d-xl-block"> | |||||
<a class="nav-link" href="">About</a> | |||||
</li> | |||||
<li class="nav-item dropdown-hover d-none d-xl-block"> | |||||
<a class="nav-link" href="">Contact</a> | |||||
</li> | |||||
</ul> | |||||
</nav> | |||||
</header> | |||||
<div class="body-wrapper overflow-hidden"> | <div class="body-wrapper overflow-hidden"> | ||||
<router-view></router-view> | <router-view></router-view> | ||||
</div> | </div> | ||||
@@ -17,49 +17,23 @@ async function postInfo() { | |||||
try { | try { | ||||
loading.value = true; | loading.value = true; | ||||
info.value = "loading..."; | info.value = "loading..."; | ||||
(await post)<any>("/create_site/company/", { | |||||
(await post)<any>("/company/", { | |||||
name: name.value, | name: name.value, | ||||
slogon: slogan.value, | slogon: slogan.value, | ||||
}) | }) | ||||
.then((res) => { | .then((res) => { | ||||
console.log(res.data); | console.log(res.data); | ||||
company_id.value = res.data.id; | company_id.value = res.data.id; | ||||
site_id.value = res.data.id | |||||
if (res.data) { | if (res.data) { | ||||
try { | |||||
post<any>("/create_site/sites/", { | |||||
site_name: name.value, | |||||
company: company_id.value, | |||||
domain_name: name.value?.toString().replace(/\s/g, ''), | |||||
}) | |||||
.then((res) => { | |||||
if (res.data) { | |||||
console.log(res.data); | |||||
site_id.value = res.data.id | |||||
post<any>("/create_site/pages/", { | |||||
site: site_id.value, | |||||
page_name: "Home", | |||||
content: '<h1>Home Page</h1>' | |||||
}).then((res) => { | |||||
console.log(res.data); | |||||
router.push( | |||||
router.push( | |||||
`site/create/${company_id.value}/${site_id.value}/palette` | `site/create/${company_id.value}/${site_id.value}/palette` | ||||
); | |||||
}); | |||||
}; | |||||
}) | |||||
.catch(() => { | |||||
loading.value = false; | |||||
info.value = "Failed. Try Again."; | |||||
}); | |||||
} catch (error) {} | |||||
); | |||||
} | } | ||||
}) | }) | ||||
.catch(() => { | |||||
.catch((error) => { | |||||
loading.value = false; | loading.value = false; | ||||
window.alert(error.response.data); | |||||
info.value = "Failed. Try Again."; | info.value = "Failed. Try Again."; | ||||
}); | }); | ||||
} catch (error) { | } catch (error) { | ||||
@@ -16,7 +16,7 @@ onMounted(() => { | |||||
async function initialize() { | async function initialize() { | ||||
try { | try { | ||||
(await get)<any>(`/create_site/sites/${id}/`).then((res) => { | |||||
(await get)<any>(`company/${id}/`).then((res) => { | |||||
console.log(res.data) | console.log(res.data) | ||||
website_title.value = res.data.site_name | website_title.value = res.data.site_name | ||||
}); | }); | ||||
@@ -30,7 +30,7 @@ async function initialize() { | |||||
const submit = () =>{ | const submit = () =>{ | ||||
try { | try { | ||||
(put)<any>(`/create_site/sites/${id}/`, { site_name:website_title.value }).then((res) => { | |||||
(put)<any>(`/company/name/${id}/`, { site_name:website_title.value }).then((res) => { | |||||
console.log('Layout updated successfully:', res.data); | console.log('Layout updated successfully:', res.data); | ||||
}); | }); | ||||
} catch (error) { | } catch (error) { | ||||
@@ -23,29 +23,24 @@ onMounted(() => { | |||||
async function initialize() { | async function initialize() { | ||||
loading.value = true; | loading.value = true; | ||||
try { | try { | ||||
(await get)<any>(`/create_site/sites/${id}/`) | |||||
(await get)<any>(`company/${id}/`) | |||||
.then((res: any) => { | .then((res: any) => { | ||||
console.log(res.data); | console.log(res.data); | ||||
site_name.value = res.data.site_name; | site_name.value = res.data.site_name; | ||||
pallete_id.value = res.data.color_swatch; | pallete_id.value = res.data.color_swatch; | ||||
company_id.value = res.data.company; | company_id.value = res.data.company; | ||||
get<any>(`/color_swatches/`) | |||||
get<any>(`/colorswatch/`) | |||||
.then((res: any) => { | .then((res: any) => { | ||||
console.log(res.data); | console.log(res.data); | ||||
res.data.forEach((element: any) => { | res.data.forEach((element: any) => { | ||||
if (element.id == pallete_id.value) { | if (element.id == pallete_id.value) { | ||||
pallete.value = element; | pallete.value = element; | ||||
get<any>(`/create_site/company/${company_id.value}/`) | |||||
get<any>(`/company/${id}/`) | |||||
.then((res: any) => { | .then((res: any) => { | ||||
site_logo.value = res.data.logo_path; | site_logo.value = res.data.logo_path; | ||||
console.log(res.data); | |||||
instagramPhoto.value = | |||||
res.data.brand_photo.instagram_brand_post; | |||||
tshirt.value = res.data.brand_photo.tshirt_brand; | |||||
console.log(instagramPhoto.value); | |||||
console.log(tshirt.value); | |||||
console.log(res.data); | |||||
loading.value = false; | loading.value = false; | ||||
}) | }) | ||||
.catch((err) => { | .catch((err) => { | ||||
@@ -134,8 +129,8 @@ async function initialize() { | |||||
<div class="container"> | <div class="container"> | ||||
<div class="row"> | <div class="row"> | ||||
<div class="col-12"> | <div class="col-12"> | ||||
<img :src="`https://api.drawise.net${site_logo}`" alt="" width="200"> | |||||
<a :href="`https://api.drawise.net${site_logo}`" download class="btn"><i class="ti ti-download fs-4 me-2"></i> Download Logo</a> | |||||
<img :src="`${site_logo}`" alt="" width="200"> | |||||
<a :href="`${site_logo}`" download class="btn"><i class="ti ti-download fs-4 me-2"></i> Download Logo</a> | |||||
</div> | </div> | ||||
<div class="col-12 mt-4"> | <div class="col-12 mt-4"> | ||||
<div class="container"> | <div class="container"> | ||||
@@ -206,10 +201,7 @@ async function initialize() { | |||||
:src="`https://api.drawise.net/${tshirt[2]}`" | :src="`https://api.drawise.net/${tshirt[2]}`" | ||||
alt="" | alt="" | ||||
/> | /> | ||||
</div> | |||||
<p class="fs-8 fw-4 mt-4 text-center"> | |||||
Instagram Posts | |||||
</p> | |||||
</div> | |||||
<div class="col-12"> | <div class="col-12"> | ||||
<div class="container"> | <div class="container"> | ||||
<div class="row"> | <div class="row"> | ||||
@@ -34,7 +34,7 @@ onMounted(() => { | |||||
async function initialize() { | async function initialize() { | ||||
try { | try { | ||||
(await get)<any>(`/create_site/sites/${id}/`).then((res) => { | |||||
(await get)<any>(`/company/${id}/`).then((res) => { | |||||
console.log(res.data); | console.log(res.data); | ||||
if (res.data) { | if (res.data) { | ||||
layout.value = res.data.layout; | layout.value = res.data.layout; | ||||
@@ -56,7 +56,7 @@ function updateLayout(newLayout: string) { | |||||
layout.value = newLayout; // Update layout immediately | layout.value = newLayout; // Update layout immediately | ||||
// Send a request to update the layout in the database | // Send a request to update the layout in the database | ||||
try { | try { | ||||
put<any>(`/create_site/sites/${id}/`, { | |||||
put<any>(`/company/${id}/`, { | |||||
layout: newLayout, | layout: newLayout, | ||||
site_name: site_name.value, | site_name: site_name.value, | ||||
}).then((res) => { | }).then((res) => { | ||||
@@ -16,13 +16,11 @@ onMounted(() => { | |||||
async function initialize() { | async function initialize() { | ||||
console.log("sjbvjs") | console.log("sjbvjs") | ||||
try { | try { | ||||
(await get)<any>("/create_site/pages/", { site: id }).then((res) => { | |||||
(await get)<any>(`/SitePages/site/${id}`).then((res) => { | |||||
console.log(res.data); | console.log(res.data); | ||||
res.data.forEach((element: any) => { | res.data.forEach((element: any) => { | ||||
console.log(element.site) | |||||
if (element.site == id) { | |||||
pages.value.push(element); | |||||
} | |||||
console.log(element.site) | |||||
pages.value.push(element); | |||||
}); | }); | ||||
console.log(pages.value); | console.log(pages.value); | ||||
}); | }); | ||||
@@ -94,7 +92,7 @@ async function initialize() { | |||||
<div class="card-body"> | <div class="card-body"> | ||||
<div class="row d-flex"> | <div class="row d-flex"> | ||||
<div class="col-6"> | <div class="col-6"> | ||||
<p class="fs-5 fw-bolder">{{ page.page_name }}</p> | |||||
<p class="fs-5 fw-bolder">{{page.page_title}}</p> | |||||
</div> | </div> | ||||
<div class="col-6 d-flex justify-content-end"> | <div class="col-6 d-flex justify-content-end"> | ||||
<RouterLink | <RouterLink | ||||
@@ -13,12 +13,12 @@ onMounted(() => { | |||||
async function initialize() { | async function initialize() { | ||||
try { | try { | ||||
const sitesResponse = await get<any>("/create_site/sites/"); | |||||
const sitesResponse = await get<any>("company/"); | |||||
const siteData = sitesResponse.data; | const siteData = sitesResponse.data; | ||||
console.log(siteData); | console.log(siteData); | ||||
// Fetch logo URLs for each site | // Fetch logo URLs for each site | ||||
const logoPromises = siteData.map((site: any) => getLogoPath(site.company)); | |||||
const logoPromises = siteData.map((site: any) => getLogoPath(site.id)); | |||||
const logoURLs = await Promise.all(logoPromises); | const logoURLs = await Promise.all(logoPromises); | ||||
// Set the data for both sites and logo URLs | // Set the data for both sites and logo URLs | ||||
@@ -34,8 +34,8 @@ async function initialize() { | |||||
async function getLogoPath(compnay_id: any) { | async function getLogoPath(compnay_id: any) { | ||||
try { | try { | ||||
const response: any = await get(`/create_site/company/${compnay_id}`); | |||||
const logoPath = "https://api.drawise.net" + response.data.logo_path; | |||||
const response: any = await get(`/company/${compnay_id}/logo`); | |||||
const logoPath = response.data.logo_path; | |||||
console.log(logoPath); | console.log(logoPath); | ||||
return logoPath; | return logoPath; | ||||
} catch (error) { | } catch (error) { | ||||
@@ -116,7 +116,7 @@ const openPage = (site: any) => { | |||||
class="d-flex align-items-center justify-content-between w-100 prof-flex" | class="d-flex align-items-center justify-content-between w-100 prof-flex" | ||||
> | > | ||||
<h1 class="fs-5 d-none-prof-500"> | <h1 class="fs-5 d-none-prof-500"> | ||||
{{ site["site_name"] }} | |||||
{{ site["name"] }} | |||||
</h1> | </h1> | ||||
<RouterLink | <RouterLink | ||||
:to="`dash/${site.id}/branding`" | :to="`dash/${site.id}/branding`" | ||||
@@ -11,6 +11,7 @@ const loading = ref<boolean>(false); | |||||
const login = async () => { | const login = async () => { | ||||
try { | try { | ||||
loading.value = true; | loading.value = true; | ||||
var buttonText=text.value; | |||||
text.value = "Loading"; | text.value = "Loading"; | ||||
(await post)<any>("/auth/login/", { | (await post)<any>("/auth/login/", { | ||||
email: email.value, | email: email.value, | ||||
@@ -24,9 +25,10 @@ const login = async () => { | |||||
router.push("dashboard"); | router.push("dashboard"); | ||||
} | } | ||||
}) | }) | ||||
.catch(() => { | |||||
.catch((error) => { | |||||
loading.value = false; | loading.value = false; | ||||
text.value = "Failed. Try Again..."; | |||||
window.alert(error.response.data); | |||||
text.value = buttonText; | |||||
}); | }); | ||||
} catch (error) { | } catch (error) { | ||||
console.error("Error making POST request:", error); | console.error("Error making POST request:", error); | ||||
@@ -40,7 +42,7 @@ onBeforeMount(() => { | |||||
const checkLoggedRedirest = async () => { | const checkLoggedRedirest = async () => { | ||||
(await get)<any>("/auth/test-token/") | (await get)<any>("/auth/test-token/") | ||||
.then(() => { | .then(() => { | ||||
window.location.replace("https://app.drawise.net/dashboard"); | |||||
window.location.replace("/dashboard"); | |||||
}); | }); | ||||
}; | }; | ||||
</script> | </script> | ||||
@@ -143,56 +145,8 @@ const checkLoggedRedirest = async () => { | |||||
> | > | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="position-relative text-center my-4"> | |||||
<p | |||||
class="mb-0 fs-4 px-3 d-inline-block bg-white text-dark z-index-5 position-relative" | |||||
> | |||||
or sign in with | |||||
</p> | |||||
<span | |||||
class="border-top w-100 position-absolute top-50 start-50 translate-middle" | |||||
></span> | |||||
</div> | |||||
<div class="row"> | |||||
<div class="col-6 mb-2 mb-sm-0"> | |||||
<a | |||||
class="btn btn-white text-dark border fw-normal d-flex align-items-center justify-content-center rounded-2 py-8" | |||||
href="javascript:void(0)" | |||||
role="button" | |||||
> | |||||
<img | |||||
src="../../public/google.svg" | |||||
alt="" | |||||
class="img-fluid me-2" | |||||
width="18" | |||||
height="18" | |||||
/> | |||||
<span | |||||
class="d-none d-sm-block me-1 flex-shrink-0" | |||||
></span | |||||
</a> | |||||
</div> | |||||
<div class="col-6"> | |||||
<a | |||||
class="btn btn-white text-dark border fw-normal d-flex align-items-center justify-content-center rounded-2 py-8" | |||||
href="javascript:void(0)" | |||||
role="button" | |||||
> | |||||
<img | |||||
src="../../public/facebook.svg" | |||||
alt="" | |||||
class="img-fluid me-2" | |||||
width="18" | |||||
height="18" | |||||
/> | |||||
<span | |||||
class="d-none d-sm-block me-1 flex-shrink-0" | |||||
></span | |||||
</a> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -12,6 +12,7 @@ const passwordConfirm = ref<any>(); | |||||
const signUp = async () => { | const signUp = async () => { | ||||
try { | try { | ||||
loading.value = true; | loading.value = true; | ||||
var buttonText=info.value; | |||||
info.value = "loading..."; | info.value = "loading..."; | ||||
(await post)<any>("/auth/signup/", { | (await post)<any>("/auth/signup/", { | ||||
email: email.value, | email: email.value, | ||||
@@ -26,9 +27,10 @@ const signUp = async () => { | |||||
router.push("dashboard"); | router.push("dashboard"); | ||||
} | } | ||||
}) | }) | ||||
.catch(() => { | |||||
.catch((error) => { | |||||
loading.value = false; | loading.value = false; | ||||
info.value = "Failed. Try Again."; | |||||
window.alert(error.response.data); | |||||
info.value = buttonText; | |||||
}); | }); | ||||
} catch (error) { | } catch (error) { | ||||
console.error("Error making POST request:", error); | console.error("Error making POST request:", error); | ||||
@@ -43,7 +45,7 @@ onBeforeMount(() => { | |||||
const checkLoggedRedirest = async () => { | const checkLoggedRedirest = async () => { | ||||
(await get)<any>("/auth/test-token/") | (await get)<any>("/auth/test-token/") | ||||
.then(() => { | .then(() => { | ||||
window.location.replace("https://app.drawise.net/dashboard"); | |||||
window.location.replace("/dashboard"); | |||||
}) | }) | ||||
}; | }; | ||||
@@ -151,56 +153,8 @@ const checkLoggedRedirest = async () => { | |||||
>Login</RouterLink | >Login</RouterLink | ||||
> | > | ||||
</div> | </div> | ||||
</div> | |||||
<div class="position-relative text-center my-4"> | |||||
<p | |||||
class="mb-0 fs-4 px-3 d-inline-block bg-white text-dark z-index-5 position-relative" | |||||
> | |||||
or register with | |||||
</p> | |||||
<span | |||||
class="border-top w-100 position-absolute top-50 start-50 translate-middle" | |||||
></span> | |||||
</div> | |||||
<div class="row"> | |||||
<div class="col-6 mb-2 mb-sm-0"> | |||||
<a | |||||
class="btn btn-white text-dark border fw-normal d-flex align-items-center justify-content-center rounded-2 py-8" | |||||
href="javascript:void(0)" | |||||
role="button" | |||||
> | |||||
<img | |||||
src="../../public/google.svg" | |||||
alt="" | |||||
class="img-fluid me-2" | |||||
width="18" | |||||
height="18" | |||||
/> | |||||
<span | |||||
class="d-none d-sm-block me-1 flex-shrink-0" | |||||
></span | |||||
</a> | |||||
</div> | |||||
<div class="col-6"> | |||||
<a | |||||
class="btn btn-white text-dark border fw-normal d-flex align-items-center justify-content-center rounded-2 py-8" | |||||
href="javascript:void(0)" | |||||
role="button" | |||||
> | |||||
<img | |||||
src="../../public/facebook.svg" | |||||
alt="" | |||||
class="img-fluid me-2" | |||||
width="18" | |||||
height="18" | |||||
/> | |||||
<span | |||||
class="d-none d-sm-block me-1 flex-shrink-0" | |||||
></span | |||||
</a> | |||||
</div> | |||||
</div> | |||||
<div class="row"> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -24,46 +24,20 @@ onMounted(() => { | |||||
async function initialize() { | async function initialize() { | ||||
loading.value = true; | loading.value = true; | ||||
try { | try { | ||||
(await get)<any>(`/create_site/sites/${id}/`) | |||||
(await get)<any>(`/company/${id}/`) | |||||
.then((res) => { | .then((res) => { | ||||
console.log(res.data); | console.log(res.data); | ||||
site_logo.value = res.data.logo_path; | |||||
site_name.value = res.data.site_name; | site_name.value = res.data.site_name; | ||||
pallete_id.value = res.data.color_swatch; | pallete_id.value = res.data.color_swatch; | ||||
get<any>(`/color_swatches/`) | |||||
get<any>(`/ColorSwatch/`) | |||||
.then((res) => { | .then((res) => { | ||||
console.log(res.data); | console.log(res.data); | ||||
res.data.forEach((element: any) => { | res.data.forEach((element: any) => { | ||||
if (element.id == pallete_id.value) { | if (element.id == pallete_id.value) { | ||||
pallete.value = element; | |||||
get<any>(`/create_site/company/${company_id}/`) | |||||
.then((res) => { | |||||
console.log(res.data); | |||||
site_logo.value = res.data.logo_path; | |||||
post<any>("/create_icon/brand_create/", { | |||||
logo_path: res.data.logo_path, | |||||
company_id: res.data.id, | |||||
}) | |||||
.then((res) => { | |||||
if (res.data) { | |||||
console.log("branding",res.data); | |||||
photos.value = res.data; | |||||
console.log(photos.value) | |||||
loading.value = false; | |||||
} | |||||
}) | |||||
.catch(() => { | |||||
loading.value = false; | |||||
text.value = "Failed. Try Again"; | |||||
}); | |||||
}) | |||||
.catch(() => { | |||||
loading.value = false; | |||||
text.value = "Failed. Refresh the page"; | |||||
}); | |||||
// '/create_icon/brand_create/',{logo_path:res.data.logo_path,company_id: company_id.value} | |||||
pallete.value = element; | |||||
} | } | ||||
loading.value = false; | |||||
}); | }); | ||||
}) | }) | ||||
.catch(() => { | .catch(() => { | ||||
@@ -134,8 +108,8 @@ async function initialize() { | |||||
<div class="container"> | <div class="container"> | ||||
<div class="row"> | <div class="row"> | ||||
<div class="col-12"> | <div class="col-12"> | ||||
<img :src="`https://api.drawise.net${site_logo}`" alt="" width="200"> | |||||
<a :href="`https://api.drawise.net${site_logo}`" download class="btn"><i class="ti ti-download fs-4 me-2"></i> Download Logo</a> | |||||
<img :src="`${site_logo}`" alt="" width="200"> | |||||
<a :href="`${site_logo}`" target="_blank" download class="btn"><i class="ti ti-download fs-4 me-2"></i> Download Logo</a> | |||||
</div> | </div> | ||||
<div class="col-12 mt-4"> | <div class="col-12 mt-4"> | ||||
<div class="container"> | <div class="container"> | ||||
@@ -2,7 +2,7 @@ | |||||
import { onMounted, ref } from "vue"; | import { onMounted, ref } from "vue"; | ||||
import { useRoute, useRouter } from "vue-router"; | import { useRoute, useRouter } from "vue-router"; | ||||
import { checkLoggedIn } from "../../../../../utils/accessTocken"; | import { checkLoggedIn } from "../../../../../utils/accessTocken"; | ||||
import { get, put } from "../../../../../utils/api"; | |||||
import { get, put,post } from "../../../../../utils/api"; | |||||
const colors = ref<any>(); | const colors = ref<any>(); | ||||
const loading = ref<boolean>(false); | const loading = ref<boolean>(false); | ||||
const text = ref<string>("Continue"); | const text = ref<string>("Continue"); | ||||
@@ -15,38 +15,15 @@ onMounted(() => { | |||||
checkLoggedIn(); | checkLoggedIn(); | ||||
initialize(); | initialize(); | ||||
}); | }); | ||||
async function initialize() { | |||||
try { | |||||
loading.value = true; | |||||
text.value = "Getting info..."; | |||||
(await get)<any>("/color_swatches/").then((res) => { | |||||
console.log(res.data); | |||||
colors.value = res.data; | |||||
loading.value = false; | |||||
text.value = "Continue"; | |||||
}); | |||||
(get)<any>(`/create_site/sites/${id}/`) | |||||
.then((res) => { | |||||
site_name.value = res.data.site_name | |||||
loading.value = false | |||||
}) | |||||
.catch(()=>{ | |||||
loading.value = false; | |||||
text.value = "Failed. Refresh the page" | |||||
}); | |||||
} catch (error) { | |||||
// Handle errors here | |||||
console.error(error); | |||||
} | |||||
async function initialize() { | |||||
} | } | ||||
const submitLayout = async () => { | const submitLayout = async () => { | ||||
loading.value = true; | loading.value = true; | ||||
text.value = "loading"; | text.value = "loading"; | ||||
(await put)<any>(`/create_site/sites/${id}/`, { | |||||
site_name: site_name.value, | |||||
(await post)<any>(`/SitePages/Layout`, { | |||||
CompanyId:id, | |||||
layout: selectedLayout.value, | layout: selectedLayout.value, | ||||
}) | }) | ||||
.then((res) => { | .then((res) => { | ||||
@@ -55,7 +32,8 @@ const submitLayout = async () => { | |||||
loading.value = false; | loading.value = false; | ||||
} | } | ||||
}) | }) | ||||
.catch(() => { | |||||
.catch((error) => { | |||||
window.alert(error.response.data); | |||||
loading.value = false; | loading.value = false; | ||||
text.value = "Failed. Try Again"; | text.value = "Failed. Try Again"; | ||||
}); | }); | ||||
@@ -13,31 +13,12 @@ const company_name = ref<string>(); | |||||
const company_slogan = ref<string>(); | const company_slogan = ref<string>(); | ||||
const selected = ref<boolean>(false); | const selected = ref<boolean>(false); | ||||
onMounted(() => { | onMounted(() => { | ||||
logos.value = JSON.parse(localStorage.getItem("logos") as string).icons; | |||||
logos.value = JSON.parse(localStorage.getItem("logos") as string); | |||||
console.log(logos.value); | console.log(logos.value); | ||||
initialize(); | initialize(); | ||||
}); | }); | ||||
async function initialize() { | async function initialize() { | ||||
loading.value = true; | |||||
try { | |||||
(await get)<any>(`/create_site/company/${company_id}/`) | |||||
.then((res) => { | |||||
console.log(res.data) | |||||
// company_id.value = res.company_id | |||||
company_name.value = res.data.name | |||||
company_slogan.value = res.data.slogon | |||||
loading.value = false | |||||
}) | |||||
.catch(()=>{ | |||||
loading.value = false; | |||||
text.value = "Failed. Refresh the page" | |||||
}) | |||||
; | |||||
} catch (error) { | |||||
// Handle errors here | |||||
console.error(error); | |||||
} | |||||
} | } | ||||
function watchSelection(url: any) { | function watchSelection(url: any) { | ||||
@@ -50,7 +31,7 @@ function watchSelection(url: any) { | |||||
const submitLogo = async () => { | const submitLogo = async () => { | ||||
loading.value = true; | loading.value = true; | ||||
text.value = "loading"; | text.value = "loading"; | ||||
(await put)<any>(`/create_site/company/${company_id}/`, { name:company_name.value,slogon:company_slogan.value,logo_path:logo.value}) | |||||
(await put)<any>(`/company/SelectLogo/`, { id:company_id,logoPath:logo.value}) | |||||
.then((res) => { | .then((res) => { | ||||
if (res.data) { | if (res.data) { | ||||
console.log(res.data) | console.log(res.data) | ||||
@@ -58,7 +39,8 @@ const submitLogo = async () => { | |||||
loading.value = false; | loading.value = false; | ||||
} | } | ||||
}) | }) | ||||
.catch(() => { | |||||
.catch((error) => { | |||||
window.alert(error.response.data); | |||||
loading.value = false; | loading.value = false; | ||||
text.value = "Failed. Try Again"; | text.value = "Failed. Try Again"; | ||||
}); | }); | ||||
@@ -130,7 +112,7 @@ const submitLogo = async () => { | |||||
:for="'logo-' + index" | :for="'logo-' + index" | ||||
> | > | ||||
<img | <img | ||||
:src="`https://api.drawise.net${logo}`" | |||||
:src="`${logo}`" | |||||
alt="" | alt="" | ||||
style="max-width: 100px" | style="max-width: 100px" | ||||
/> | /> | ||||
@@ -141,6 +123,7 @@ const submitLogo = async () => { | |||||
@click="submitLogo" | @click="submitLogo" | ||||
:disabled="loading || !selected" | :disabled="loading || !selected" | ||||
class="btn btn-success w-100 py-8 mb-4 rounded-2" | class="btn btn-success w-100 py-8 mb-4 rounded-2" | ||||
style="position:fixed;left:0;bottom:1vh;" | |||||
> | > | ||||
{{ text }} | {{ text }} | ||||
<i class="ti ti-chevron-right fs-4 me-2"></i> | <i class="ti ti-chevron-right fs-4 me-2"></i> | ||||
@@ -20,14 +20,14 @@ async function initialize() { | |||||
try { | try { | ||||
loading.value = true; | loading.value = true; | ||||
text.value = "Getting info..."; | text.value = "Getting info..."; | ||||
(await get)<any>("/color_swatches/").then((res) => { | |||||
(await get)<any>("/ColorSwatch/").then((res) => { | |||||
console.log(res.data); | console.log(res.data); | ||||
colors.value = res.data; | colors.value = res.data; | ||||
loading.value = false; | loading.value = false; | ||||
text.value = "Continue"; | text.value = "Continue"; | ||||
}); | }); | ||||
(get)<any>(`/create_site/sites/${id}/`) | |||||
(get)<any>(`/company/${id}/`) | |||||
.then((res) => { | .then((res) => { | ||||
site_name.value = res.data.site_name | site_name.value = res.data.site_name | ||||
loading.value = false | loading.value = false | ||||
@@ -49,7 +49,7 @@ const watchSelection = (id: any) => { | |||||
const submitPalette = async () => { | const submitPalette = async () => { | ||||
loading.value = true; | loading.value = true; | ||||
text.value = "loading"; | text.value = "loading"; | ||||
(await put)<any>(`/create_site/sites/${id}/`, { | |||||
(await put)<any>(`/company/${id}/color`, { | |||||
site_name: site_name.value, | site_name: site_name.value, | ||||
color_swatch: selected.value, | color_swatch: selected.value, | ||||
}) | }) | ||||
@@ -60,8 +60,9 @@ const submitPalette = async () => { | |||||
loading.value = false; | loading.value = false; | ||||
} | } | ||||
}) | }) | ||||
.catch(() => { | |||||
.catch((error) => { | |||||
loading.value = false; | loading.value = false; | ||||
window.alert(error.response.data); | |||||
text.value = "Failed. Try Again"; | text.value = "Failed. Try Again"; | ||||
}); | }); | ||||
console.log("alert"); | console.log("alert"); | ||||
@@ -23,7 +23,7 @@ onMounted(() => { | |||||
async function initialize() { | async function initialize() { | ||||
loading.value = true; | loading.value = true; | ||||
try { | try { | ||||
(await get)<any>("/tag/") | |||||
(await get)<any>("/tag/string") | |||||
.then((res) => { | .then((res) => { | ||||
console.log(res.data); | console.log(res.data); | ||||
tags.value = res.data; | tags.value = res.data; | ||||
@@ -32,16 +32,7 @@ async function initialize() { | |||||
.catch(() => { | .catch(() => { | ||||
loading.value = false; | loading.value = false; | ||||
text.value = "Server is crowded. Please try again"; | text.value = "Server is crowded. Please try again"; | ||||
}); | |||||
get<any>(`/create_site/sites/${id}/`) | |||||
.then((res) => { | |||||
site_name.value = res.data.site_name; | |||||
loading.value = false; | |||||
}) | |||||
.catch(() => { | |||||
loading.value = false; | |||||
text.value = "Failed. Refresh the page"; | |||||
}); | |||||
}); | |||||
} catch (error) { | } catch (error) { | ||||
// Handle errors here | // Handle errors here | ||||
console.error(error); | console.error(error); | ||||
@@ -88,9 +79,10 @@ async function submitTags() { | |||||
try { | try { | ||||
loading.value = true; | loading.value = true; | ||||
text.value = "loading"; | text.value = "loading"; | ||||
(await post)<any>("/create_icon/create_icon/", { | |||||
(await post)<any>("/company/createLogo/", { | |||||
id:''+id, | |||||
text: site_name.value, | text: site_name.value, | ||||
tags: selected.value, | |||||
tags: selected.value, | |||||
}) | }) | ||||
.then((res) => { | .then((res) => { | ||||
if (res.data) { | if (res.data) { | ||||
@@ -5,7 +5,7 @@ import { ref, onMounted, computed } from "vue"; | |||||
import { useRoute, useRouter } from "vue-router"; | import { useRoute, useRouter } from "vue-router"; | ||||
import { checkLoggedIn } from "./../../../../utils/accessTocken"; | import { checkLoggedIn } from "./../../../../utils/accessTocken"; | ||||
import { get, put, post, remove } from "./../../../../utils/apiFrom"; | import { get, put, post, remove } from "./../../../../utils/apiFrom"; | ||||
import { post as postAPI } from "./../../../../utils/api"; | |||||
import { post as postAPI,put as putAPI } from "./../../../../utils/api"; | |||||
import axios from "axios"; | import axios from "axios"; | ||||
const saving = ref<boolean>(false); | const saving = ref<boolean>(false); | ||||
const savingText = ref<string>("Save"); | const savingText = ref<string>("Save"); | ||||
@@ -28,11 +28,11 @@ onMounted(() => { | |||||
async function initialize() { | async function initialize() { | ||||
try { | try { | ||||
(await get)<any>(`/create_site/pages/${id}/`).then((res) => { | |||||
(await get)<any>(`/SitePages/ForEdit/${id}/`).then((res) => { | |||||
console.log(res.data); | console.log(res.data); | ||||
if (res.data) { | if (res.data) { | ||||
site_id.value = res.data.site; | |||||
quill.value.setHTML(res.data.content); | |||||
site_id.value = res.data.site_id; | |||||
quill.value.setHTML(res.data.page_content); | |||||
page_name.value = res.data.page_name; | page_name.value = res.data.page_name; | ||||
console.log(site_id.value); | console.log(site_id.value); | ||||
images.value = res.data.image; | images.value = res.data.image; | ||||
@@ -49,7 +49,7 @@ async function editPage() { | |||||
try { | try { | ||||
saving.value = true; | saving.value = true; | ||||
savingText.value = "Saving..."; | savingText.value = "Saving..."; | ||||
(await put)<any>(`/create_site/pages/${id}/`, { | |||||
(await putAPI)<any>(`/SitePages/${id}/`, { | |||||
site: site_id.value, | site: site_id.value, | ||||
page_name: page_name.value, | page_name: page_name.value, | ||||
content: quill.value.getHTML(), | content: quill.value.getHTML(), | ||||
@@ -72,20 +72,9 @@ const imgGen = ref<string>("Generate"); | |||||
const sendPicogen = () => { | const sendPicogen = () => { | ||||
loadingImage.value = true; | loadingImage.value = true; | ||||
imgGen.value = "Generating..."; | imgGen.value = "Generating..."; | ||||
post<any>(`/create_site/picogen/`, { prompt: picogenProp.value }) | |||||
postAPI<any>(`/SitePages/picogen/`, { request: picogenProp.value,pageId:id }) | |||||
.then((res) => { | .then((res) => { | ||||
console.log(res.data[0]); | |||||
imgGen.value = "Generate"; | |||||
postAPI<any>(`/create_site/picogen/`, { url: res.data[0] , page_id: route.params.id}) | |||||
.then((res) => { | |||||
console.log(res.data) | |||||
loadingImage.value = false; | |||||
router.go(0) | |||||
}) | |||||
.catch(() => { | |||||
loadingImage.value = false; | |||||
imgGen.value = "Failed, Try Again"; | |||||
}); | |||||
window.location.reload(); | |||||
}) | }) | ||||
.catch(() => { | .catch(() => { | ||||
loadingImage.value = false; | loadingImage.value = false; | ||||
@@ -125,13 +114,12 @@ const sendPostRequest = async () => { | |||||
quill.value.setHTML("<p>Generating ... </p>"); | quill.value.setHTML("<p>Generating ... </p>"); | ||||
loadingText.value = true; | loadingText.value = true; | ||||
try { | try { | ||||
await axios | |||||
.post("https://avindev.com/bot/public/drawise", { | |||||
text: text.value + " in HTML Format only <body>", | |||||
postAPI<any>(`/SitePages/gpt`, { | |||||
request: text.value, | |||||
}) | }) | ||||
.then((res: any) => { | .then((res: any) => { | ||||
console.log(res.data.text); | |||||
quill.value.setHTML(res.data.text); | |||||
console.log(res.data); | |||||
quill.value.setHTML(res.data); | |||||
loadingText.value = false; | loadingText.value = false; | ||||
}) | }) | ||||
.catch(() => { | .catch(() => { | ||||
@@ -152,7 +140,7 @@ const selectedImageIds = computed(() => { | |||||
}); | }); | ||||
const deleteImage = async (id: any) => { | const deleteImage = async (id: any) => { | ||||
(await remove)<any>(`/create_site/images/${id}`) | |||||
(await remove)<any>(`/SitePages/image/${id}`) | |||||
.then((res: any) => { | .then((res: any) => { | ||||
console.log(res.data); | console.log(res.data); | ||||
router.go(0); | router.go(0); | ||||
@@ -301,12 +289,12 @@ const deleteImage = async (id: any) => { | |||||
/> | /> | ||||
<span class="checkbox-tile"> | <span class="checkbox-tile"> | ||||
<img | <img | ||||
:src="`https://api.drawise.net${image.image}`" | |||||
:src="`${image}`" | |||||
alt="" | alt="" | ||||
style="max-width: 150px" | style="max-width: 150px" | ||||
/> | /> | ||||
<button | <button | ||||
@click="deleteImage(image.id)" | |||||
@click="deleteImage(id)" | |||||
class="btn btn-outline-danger btn-sm p-1 m-1" | class="btn btn-outline-danger btn-sm p-1 m-1" | ||||
> | > | ||||
<i class="ti ti-trash fs-4"></i> | <i class="ti ti-trash fs-4"></i> | ||||
@@ -43,15 +43,15 @@ async function initialize() { | |||||
layout.value = "left"; | layout.value = "left"; | ||||
try { | try { | ||||
(await get)<any>(`/create_site/pages/${id}`).then((res) => { | |||||
(await get)<any>(`/SitePages/${id}`).then((res) => { | |||||
console.log(res.data); | console.log(res.data); | ||||
if (res.data) { | if (res.data) { | ||||
page_title.value = res.data.page_name; | |||||
page_content.value = res.data.content; | |||||
site_id.value = res.data.site; | |||||
page_title.value = res.data.page_title; | |||||
page_content.value = res.data.page_content; | |||||
site_id.value = res.data.site_id; | |||||
images.value = res.data.image; | images.value = res.data.image; | ||||
getPages(); | getPages(); | ||||
console.log(page_content.value); | |||||
console.log("page content:"+page_content.value); | |||||
getLayout(); | getLayout(); | ||||
} | } | ||||
}); | }); | ||||
@@ -62,7 +62,7 @@ async function initialize() { | |||||
} | } | ||||
async function getPages() { | async function getPages() { | ||||
try { | try { | ||||
(await get)<any>("/create_site/pages/", { site: id }).then((res) => { | |||||
(await get)<any>(`/SitePages/site/${site_id.value}`).then((res) => { | |||||
console.log(res.data); | console.log(res.data); | ||||
pages.value = res.data; | pages.value = res.data; | ||||
}); | }); | ||||
@@ -72,30 +72,15 @@ async function getPages() { | |||||
} | } | ||||
} | } | ||||
async function getLayout() { | async function getLayout() { | ||||
(await get)<any>(`/create_site/sites/${site_id.value}`).then((res) => { | |||||
(await get)<any>(`/company/${site_id.value}`).then((res) => { | |||||
console.log(res.data); | console.log(res.data); | ||||
if (res.data) { | if (res.data) { | ||||
layout.value = res.data.layout; | layout.value = res.data.layout; | ||||
site_logo.value = res.data.logo_path; | site_logo.value = res.data.logo_path; | ||||
site_name.value = res.data.site_name; | site_name.value = res.data.site_name; | ||||
pallete_id.value = res.data.color_swatch; | pallete_id.value = res.data.color_swatch; | ||||
get<any>(`/create_site/company/${res.data.company}`).then((res) => { | |||||
console.log(res.data); | |||||
if (res.data) { | |||||
site_logo.value = res.data.logo_path; | |||||
get<any>(`/color_swatches/`).then((res) => { | |||||
res.data.forEach((element: any) => { | |||||
if (element.id == pallete_id.value) { | |||||
loading.value = false; | |||||
pallete.value = element; | |||||
console.log(pallete.value); | |||||
} | |||||
}); | |||||
}); | |||||
} | |||||
}); | |||||
console.log(page_content.value); | |||||
loading.value = false; | |||||
console.log("page content:"+page_content.value); | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
@@ -121,7 +106,7 @@ const unescapedPageContent = computed(() => { | |||||
<nav class="navbar navbar-expand-lg fixed-top navbar-fixed-top"> | <nav class="navbar navbar-expand-lg fixed-top navbar-fixed-top"> | ||||
<a class="navbar-brand scroll" href="index-celebrity.html#home"> | <a class="navbar-brand scroll" href="index-celebrity.html#home"> | ||||
<img | <img | ||||
:src="`https://api.drawise.net${site_logo}`" | |||||
:src="`${site_logo}`" | |||||
width="80" | width="80" | ||||
alt="logo" | alt="logo" | ||||
/> | /> | ||||
@@ -134,7 +119,7 @@ const unescapedPageContent = computed(() => { | |||||
:to="`./${site_name}/${page.id}`" | :to="`./${site_name}/${page.id}`" | ||||
class="nav-link font scroll" | class="nav-link font scroll" | ||||
> | > | ||||
{{ page.page_name }} | |||||
{{ page.page_title }} | |||||
</RouterLink> | </RouterLink> | ||||
</li> | </li> | ||||
</ul> | </ul> | ||||
@@ -148,7 +133,7 @@ const unescapedPageContent = computed(() => { | |||||
<div class="inner-wrapper"> | <div class="inner-wrapper"> | ||||
<div class="sidemenu-image"> | <div class="sidemenu-image"> | ||||
<a class="scroll" href="index-celebrity.html#home"> | <a class="scroll" href="index-celebrity.html#home"> | ||||
<img :src="`https://api.drawise.net${site_logo}`" alt="image" | |||||
<img :src="`${site_logo}`" alt="image" | |||||
/></a> | /></a> | ||||
</div> | </div> | ||||
<span class="btn-close" id="btn_sideNavClose"><i></i><i></i></span> | <span class="btn-close" id="btn_sideNavClose"><i></i><i></i></span> | ||||
@@ -231,7 +216,7 @@ const unescapedPageContent = computed(() => { | |||||
<section | <section | ||||
class="banner-section" | class="banner-section" | ||||
id="home" | id="home" | ||||
:style="`background-image:url(https://api.drawise.net${images[0].image}) ;`" | |||||
:style="`background-image:url(${images[0]}) ;`" | |||||
> | > | ||||
<div class="container"> | <div class="container"> | ||||
<div class="rectangle wow slideInDown" data-wow-delay="1500ms"> | <div class="rectangle wow slideInDown" data-wow-delay="1500ms"> | ||||
@@ -302,7 +287,7 @@ const unescapedPageContent = computed(() => { | |||||
<div class="col-lg-6 col-md-12 col-sm-12 img-section"> | <div class="col-lg-6 col-md-12 col-sm-12 img-section"> | ||||
<img | <img | ||||
:src="`https://api.drawise.net${images[1].image}`" | |||||
:src="`${images[1]}`" | |||||
alt="img" | alt="img" | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -369,7 +354,7 @@ const unescapedPageContent = computed(() => { | |||||
<div class="container radius nav-box-shadow"> | <div class="container radius nav-box-shadow"> | ||||
<a class="logo link" href="javascript:void(0)"> | <a class="logo link" href="javascript:void(0)"> | ||||
<img | <img | ||||
:src="`https://api.drawise.net${site_logo}`" | |||||
:src="`${site_logo}`" | |||||
width="50" | width="50" | ||||
alt="logo" | alt="logo" | ||||
title="Logo" | title="Logo" | ||||
@@ -398,7 +383,7 @@ const unescapedPageContent = computed(() => { | |||||
<div | <div | ||||
id="particles-js" | id="particles-js" | ||||
class="particle2 parallax-setting bg-img-1 bg-img-setting not-full" | class="particle2 parallax-setting bg-img-1 bg-img-setting not-full" | ||||
:style="`background-image:linear-gradient(60deg, rgba(220, 207, 53, 0.76) 0%, rgba(220, 53, 69, 0.67) 70%), url(https://api.drawise.net${images[0].image}) ;`" | |||||
:style="`background-image:linear-gradient(60deg, rgba(220, 207, 53, 0.76) 0%, rgba(220, 53, 69, 0.67) 70%), url(${images[0]}) ;`" | |||||
> | > | ||||
<div class="bg-overlay bg-gradient"></div> | <div class="bg-overlay bg-gradient"></div> | ||||
<div class="not-fullscreen"> | <div class="not-fullscreen"> | ||||
@@ -406,7 +391,7 @@ const unescapedPageContent = computed(() => { | |||||
<div class="personal-box"> | <div class="personal-box"> | ||||
<div class="myphoto"> | <div class="myphoto"> | ||||
<img | <img | ||||
:src="`https://api.drawise.net${images[1].image}`" | |||||
:src="`${images[1]}`" | |||||
alt="image" | alt="image" | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -429,7 +414,7 @@ const unescapedPageContent = computed(() => { | |||||
<div class="hover-effect"> | <div class="hover-effect"> | ||||
<img | <img | ||||
alt="about" | alt="about" | ||||
:src="`https://api.drawise.net${images[2].image}`" | |||||
:src="`${images[2]}`" | |||||
class="about-img w-100" | class="about-img w-100" | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -510,13 +495,13 @@ const unescapedPageContent = computed(() => { | |||||
<a href="index-cycling.html#home" title="Logo" class="logo scroll"> | <a href="index-cycling.html#home" title="Logo" class="logo scroll"> | ||||
<!--Logo Default--> | <!--Logo Default--> | ||||
<img | <img | ||||
:src="`https://api.drawise.net${site_logo}`" | |||||
:src="`${site_logo}`" | |||||
alt="logo" | alt="logo" | ||||
width="60" | width="60" | ||||
class="m-0 logo-img" | class="m-0 logo-img" | ||||
/> | /> | ||||
<img | <img | ||||
:src="`https://api.drawise.net${site_logo}`" | |||||
:src="`${site_logo}`" | |||||
alt="logo" | alt="logo" | ||||
class="m-0 logo-dark" | class="m-0 logo-dark" | ||||
/> | /> | ||||
@@ -610,7 +595,7 @@ const unescapedPageContent = computed(() => { | |||||
<!-- Header end --> | <!-- Header end --> | ||||
<!-- banner start --> | <!-- banner start --> | ||||
<section class="banner-see bg-banner" id="banner" :style="`background-image:url(https://api.drawise.net${images[1].image});`"> | |||||
<section class="banner-see bg-banner" id="banner" :style="`background-image:url(${images[1]});`"> | |||||
<div class="container"> | <div class="container"> | ||||
<div class="row height"> | <div class="row height"> | ||||
<div class="col-lg-6 d-flex align-items-center"> | <div class="col-lg-6 d-flex align-items-center"> | ||||
@@ -629,7 +614,7 @@ const unescapedPageContent = computed(() => { | |||||
<div class="row"> | <div class="row"> | ||||
<div class=" col-sm-12 col-md-12 col-lg-6 img-sec wow fadeInLeft" data-wow-duration="1s" data-wow-delay=".5s"> | <div class=" col-sm-12 col-md-12 col-lg-6 img-sec wow fadeInLeft" data-wow-duration="1s" data-wow-delay=".5s"> | ||||
<div class="about_img margin_aboutimg"> | <div class="about_img margin_aboutimg"> | ||||
<img :src="`https://api.drawise.net${images[0].image}`" alt="about"> | |||||
<img :src="`${images[0]}`" alt="about"> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="col-sm-12 col-md-12 col-lg-6"> | <div class="col-sm-12 col-md-12 col-lg-6"> | ||||
@@ -47063,7 +47063,8 @@ html[dir=rtl] .welcome-bg-img { | |||||
.app-header .container-sm, | .app-header .container-sm, | ||||
.app-header .container-xl, | .app-header .container-xl, | ||||
.app-header .container-xxl { | .app-header .container-xxl { | ||||
padding: 0 20px | |||||
padding: 0 20px; | |||||
display:none; | |||||
} | } | ||||
.navbar-nav .dropdown-menu { | .navbar-nav .dropdown-menu { | ||||
@@ -44,7 +44,7 @@ async function checkLoggedIn () { | |||||
.then((res)=>{ | .then((res)=>{ | ||||
console.log(res.data) | console.log(res.data) | ||||
}).catch(()=>{ | }).catch(()=>{ | ||||
// window.location.replace("https://app.drawise.net/signup"); | |||||
// window.location.replace("https://api.drawise.net/signup"); | |||||
}); | }); | ||||
} catch (error) { | } catch (error) { | ||||
@@ -19,7 +19,7 @@ export async function get<T>( | |||||
): Promise<AxiosResponse<T>> { | ): Promise<AxiosResponse<T>> { | ||||
const config: AxiosRequestConfig = { | const config: AxiosRequestConfig = { | ||||
headers: { | headers: { | ||||
Authorization: getAccessToken() ? `token ${getAccessToken()}` : undefined, | |||||
Authorization: getAccessToken() ? `Bearer ${getAccessToken()}` : undefined, | |||||
}, | }, | ||||
params: params, | params: params, | ||||
}; | }; | ||||
@@ -31,7 +31,7 @@ export async function get<T>( | |||||
export async function post<T>(url: string, data: any): Promise<AxiosResponse<T>> { | export async function post<T>(url: string, data: any): Promise<AxiosResponse<T>> { | ||||
const config: AxiosRequestConfig = { | const config: AxiosRequestConfig = { | ||||
headers: { | headers: { | ||||
Authorization: getAccessToken() ? `token ${getAccessToken()}` : undefined, | |||||
Authorization: getAccessToken() ? `Bearer ${getAccessToken()}` : undefined, | |||||
}, | }, | ||||
}; | }; | ||||
@@ -42,7 +42,7 @@ export async function post<T>(url: string, data: any): Promise<AxiosResponse<T>> | |||||
export async function put<T>(url: string, data: any): Promise<AxiosResponse<T>> { | export async function put<T>(url: string, data: any): Promise<AxiosResponse<T>> { | ||||
const config: AxiosRequestConfig = { | const config: AxiosRequestConfig = { | ||||
headers: { | headers: { | ||||
Authorization: getAccessToken() ? `token ${getAccessToken()}` : undefined, | |||||
Authorization: getAccessToken() ? `Bearer ${getAccessToken()}` : undefined, | |||||
}, | }, | ||||
}; | }; | ||||
@@ -52,7 +52,7 @@ export async function put<T>(url: string, data: any): Promise<AxiosResponse<T>> | |||||
export async function remove<T>(url: string): Promise<AxiosResponse<T>> { | export async function remove<T>(url: string): Promise<AxiosResponse<T>> { | ||||
const config: AxiosRequestConfig = { | const config: AxiosRequestConfig = { | ||||
headers: { | headers: { | ||||
Authorization: getAccessToken() ? `token ${getAccessToken()}` : undefined, | |||||
Authorization: getAccessToken() ? `Bearer ${getAccessToken()}` : undefined, | |||||
}, | }, | ||||
}; | }; | ||||
@@ -19,7 +19,7 @@ export async function get<T>( | |||||
): Promise<AxiosResponse<T>> { | ): Promise<AxiosResponse<T>> { | ||||
const config: AxiosRequestConfig = { | const config: AxiosRequestConfig = { | ||||
headers: { | headers: { | ||||
Authorization: getAccessToken() ? `token ${getAccessToken()}` : undefined, | |||||
Authorization: getAccessToken() ? `Bearer ${getAccessToken()}` : undefined, | |||||
}, | }, | ||||
params: params, | params: params, | ||||
}; | }; | ||||
@@ -31,7 +31,7 @@ export async function get<T>( | |||||
export async function post<T>(url: string, data: any): Promise<AxiosResponse<T>> { | export async function post<T>(url: string, data: any): Promise<AxiosResponse<T>> { | ||||
const config: AxiosRequestConfig = { | const config: AxiosRequestConfig = { | ||||
headers: { | headers: { | ||||
Authorization: getAccessToken() ? `token ${getAccessToken()}` : undefined, | |||||
Authorization: getAccessToken() ? `Bearer ${getAccessToken()}` : undefined, | |||||
}, | }, | ||||
}; | }; | ||||
@@ -42,7 +42,7 @@ export async function post<T>(url: string, data: any): Promise<AxiosResponse<T>> | |||||
export async function put<T>(url: string, data: any): Promise<AxiosResponse<T>> { | export async function put<T>(url: string, data: any): Promise<AxiosResponse<T>> { | ||||
const config: AxiosRequestConfig = { | const config: AxiosRequestConfig = { | ||||
headers: { | headers: { | ||||
Authorization: getAccessToken() ? `token ${getAccessToken()}` : undefined, | |||||
Authorization: getAccessToken() ? `Bearer ${getAccessToken()}` : undefined, | |||||
}, | }, | ||||
}; | }; | ||||
@@ -53,7 +53,7 @@ export async function put<T>(url: string, data: any): Promise<AxiosResponse<T>> | |||||
export async function remove<T>(url: string): Promise<AxiosResponse<T>> { | export async function remove<T>(url: string): Promise<AxiosResponse<T>> { | ||||
const config: AxiosRequestConfig = { | const config: AxiosRequestConfig = { | ||||
headers: { | headers: { | ||||
Authorization: getAccessToken() ? `token ${getAccessToken()}` : undefined, | |||||
Authorization: getAccessToken() ? `Bearer ${getAccessToken()}` : undefined, | |||||
}, | }, | ||||
}; | }; | ||||