Commit e5070609 authored by Arthur.Pautrel's avatar Arthur.Pautrel
Browse files

Display price on frontend

parent 8fa5ad73
import{o as i,c as a,a as e,b as u,u as y,R as k,w as $,d as M,F as h,e as R,f as _,v as m,t as g,g as P,p as L,h as x,r as w,i as V,j as I,k as S,l as E,m as O,n as F,q as T}from"./vendor.195d4a6b.js";const Q=function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))p(s);new MutationObserver(s=>{for(const n of s)if(n.type==="childList")for(const r of n.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&p(r)}).observe(document,{childList:!0,subtree:!0});function l(s){const n={};return s.integrity&&(n.integrity=s.integrity),s.referrerpolicy&&(n.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?n.credentials="include":s.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function p(s){if(s.ep)return;s.ep=!0;const n=l(s);fetch(s.href,n)}};Q();const j=R("Login"),B=R("Register"),D=R("Market"),A={setup(t){return(o,l)=>(i(),a(h,null,[e("header",null,[e("nav",null,[u(y(k),{to:"/"},{default:$(()=>[j]),_:1}),u(y(k),{to:"/register"},{default:$(()=>[B]),_:1}),u(y(k),{to:"/market"},{default:$(()=>[D]),_:1})])]),u(y(M))],64))}};var J="/assets/loginLogo.4c8cccd3.png";var b=(t,o)=>{const l=t.__vccOpts||t;for(const[p,s]of o)l[p]=s;return l};const X={data(){return{dataLogin:{email:"",password:""},error:""}},methods:{submitLogin(){this.$http.post("http://localhost:3001/auth/login",this.dataLogin).then(t=>{t.data.success?this.$router.push({name:"market"}):this.error=t.data.error}).catch(t=>{console.log(t)})}}},f=t=>(L("data-v-2dcaf03b"),t=t(),x(),t),H=f(()=>e("link",{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css",integrity:"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T",crossorigin:"anonymous"},null,-1)),W={class:"border"},q=f(()=>e("img",{id:"loginLogo",src:J},null,-1)),Y={class:"form-group"},Z=f(()=>e("label",null,"Email",-1)),K=f(()=>e("p",null,null,-1)),z={class:"form-group"},G=f(()=>e("label",null,"Password",-1)),ee=f(()=>e("button",{id:"submitButton",type:"submit"},"Login",-1)),te={class:"errorMsg"};function se(t,o,l,p,s,n){return i(),a(h,null,[H,e("form",{method:"post",onSubmit:o[2]||(o[2]=P((...r)=>n.submitLogin&&n.submitLogin(...r),["prevent"]))},[e("div",W,[q,e("div",Y,[Z,_(e("input",{class:"form-control","onUpdate:modelValue":o[0]||(o[0]=r=>s.dataLogin.email=r),placeholder:"Enter Email"},null,512),[[m,s.dataLogin.email]]),K]),e("div",z,[G,_(e("input",{class:"form-control",type:"password","onUpdate:modelValue":o[1]||(o[1]=r=>s.dataLogin.password=r),placeholder:"Enter Password"},null,512),[[m,s.dataLogin.password]])]),ee,e("p",te,g(s.error),1)])],32)],64)}var oe=b(X,[["render",se],["__scopeId","data-v-2dcaf03b"]]);const re={setup(t){return(o,l)=>(i(),a("main",null,[u(oe)]))}};const ne={data(){return{dataRegister:{email:"",username:"",firstName:"",lastName:"",password:"",repeatPassword:""},error:""}},methods:{submitRegister(){this.$http.post("http://localhost:3001/auth/register",this.dataRegister).then(t=>{console.log(t.data),t.data.success?this.$router.push({name:"login"}):this.error=t.data.error}).catch(t=>{console.log(t)})}}},d=t=>(L("data-v-630eccfb"),t=t(),x(),t),ie=d(()=>e("link",{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css",integrity:"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T",crossorigin:"anonymous"},null,-1)),ae={class:"border"},le=d(()=>e("h2",null,"Sign Up",-1)),ce=d(()=>e("p",{id:"textAboveSignup"},"Please fill in the form to create an account",-1)),de={class:"form-group"},ue=d(()=>e("label",null,"Email",-1)),pe={class:"form-group"},_e=d(()=>e("label",null,"Username",-1)),me={class:"form-group"},he=d(()=>e("label",null,"First Name",-1)),ge={class:"form-group"},fe=d(()=>e("label",null,"Last Name",-1)),ve={class:"form-group"},ye=d(()=>e("label",null,"Password",-1)),be={class:"form-group"},ke=d(()=>e("label",null,"Repeat Password",-1)),$e=d(()=>e("button",{id:"submitButton",type:"submit"},"Sign Up",-1)),we={class:"errorMsg"};function Re(t,o,l,p,s,n){return i(),a(h,null,[ie,e("form",{method:"post",onSubmit:o[6]||(o[6]=P((...r)=>n.submitRegister&&n.submitRegister(...r),["prevent"]))},[e("div",ae,[le,ce,e("div",de,[ue,_(e("input",{class:"form-control",type:"email","onUpdate:modelValue":o[0]||(o[0]=r=>s.dataRegister.email=r),placeholder:"Enter Email"},null,512),[[m,s.dataRegister.email]])]),e("div",pe,[_e,_(e("input",{class:"form-control","onUpdate:modelValue":o[1]||(o[1]=r=>s.dataRegister.username=r),placeholder:"Username"},null,512),[[m,s.dataRegister.username]])]),e("div",me,[he,_(e("input",{class:"form-control","onUpdate:modelValue":o[2]||(o[2]=r=>s.dataRegister.firstName=r),placeholder:"First Name"},null,512),[[m,s.dataRegister.firstName]])]),e("div",ge,[fe,_(e("input",{class:"form-control","onUpdate:modelValue":o[3]||(o[3]=r=>s.dataRegister.lastName=r),placeholder:"Last Name"},null,512),[[m,s.dataRegister.lastName]])]),e("div",ve,[ye,_(e("input",{class:"form-control",type:"password","onUpdate:modelValue":o[4]||(o[4]=r=>s.dataRegister.password=r),placeholder:"Create your Password"},null,512),[[m,s.dataRegister.password]])]),e("div",be,[ke,_(e("input",{class:"form-control",type:"password","onUpdate:modelValue":o[5]||(o[5]=r=>s.dataRegister.repeatPassword=r),placeholder:"Repeat your Password"},null,512),[[m,s.dataRegister.repeatPassword]])]),$e,e("p",we,g(s.error),1)])],32)],64)}var Le=b(ne,[["render",Re],["__scopeId","data-v-630eccfb"]]);const xe={setup(t){return(o,l)=>(i(),a("main",null,[u(Le)]))}};const Ce={props:{product:""}},v=t=>(L("data-v-7b61759a"),t=t(),x(),t),Ie={class:"borderProduct"},Pe=v(()=>e("span",{class:"colorIdentifierFields"},"Name : ",-1)),Ne=v(()=>e("p",null,null,-1)),Ue=v(()=>e("span",{class:"colorIdentifierFields"},"Description : ",-1)),Me=v(()=>e("p",null,null,-1)),Ve=v(()=>e("span",{class:"colorIdentifierFields"},"Url image : ",-1));function Se(t,o,l,p,s,n){return i(),a("div",Ie,[Pe,e("span",null,g(l.product.title),1),Ne,Ue,e("span",null,g(l.product.desc),1),Me,Ve,e("span",null,g(l.product.imageUrl),1)])}var N=b(Ce,[["render",Se],["__scopeId","data-v-7b61759a"]]);const Ee={data(){return{categories:[],items:[],products:[],categoryClickedId:"",itemClickedId:""}},methods:{categoryClicked:function(t){this.categoryClickedId=t,this.itemClickedId=""},itemClicked:function(t){this.itemClickedId=t}},async created(){try{const t=await this.$http.get("http://localhost:3001/category/all");this.categories=t.data.data}catch(t){console.log(t)}try{const t=await this.$http.get("http://localhost:3001/item/all");this.items=t.data.data}catch(t){console.log(t)}try{const t=await this.$http.get("http://localhost:3001/product/all");this.products=t.data.data}catch(t){console.log(t)}},components:{Product:N}},Oe=e("div",{id:"app"},[e("h1",null,"MarketPlace")],-1),Fe=e("h2",null,"Categories",-1),Te=["onClick"],Qe=e("h2",null,"Items",-1),je=["onClick"],Be=e("h2",null,"Products",-1),De={key:0};function Ae(t,o,l,p,s,n){const r=V("Product");return i(),a(h,null,[Oe,Fe,(i(!0),a(h,null,w(s.categories,c=>(i(),a("ul",{id:"categories",key:c._id},[e("li",{onClick:U=>n.categoryClicked(c._id)},g(c.name),9,Te)]))),128)),Qe,(i(!0),a(h,null,w(s.items,c=>(i(),a("ul",{id:"items",key:c._id},[c.category==this.categoryClickedId?(i(),a("li",{key:0,onClick:U=>n.itemClicked(c._id)},g(c.name),9,je)):I("",!0)]))),128)),Be,(i(!0),a(h,null,w(s.products,c=>(i(),a("ul",{key:c._id},[c.item==this.itemClickedId?(i(),a("li",De,[u(r,{product:c},null,8,["product"])])):I("",!0)]))),128))],64)}var Je=b(Ee,[["render",Ae]]);const Xe={setup(t){return(o,l)=>(i(),a("main",null,[u(Je)]))}},He={setup(t){return(o,l)=>(i(),a("main",null,[u(N)]))}},We=S({history:E("/"),routes:[{path:"/",name:"login",component:re},{path:"/register",name:"register",component:xe},{path:"/market",name:"market",component:Xe},{path:"/product",name:"product",component:He}]}),C=O(A);C.use(We);C.use(F,T);C.mount("#app");
:root{--vt-c-white: #ffffff;--vt-c-white-soft: #f8f8f8;--vt-c-white-mute: #f2f2f2;--vt-c-black: #181818;--vt-c-black-soft: #222222;--vt-c-black-mute: #282828;--vt-c-indigo: #2c3e50;--vt-c-divider-light-1: rgba(60, 60, 60, .29);--vt-c-divider-light-2: rgba(60, 60, 60, .12);--vt-c-divider-dark-1: rgba(84, 84, 84, .65);--vt-c-divider-dark-2: rgba(84, 84, 84, .48);--vt-c-text-light-1: var(--vt-c-indigo);--vt-c-text-light-2: rgba(60, 60, 60, .66);--vt-c-text-dark-1: var(--vt-c-white);--vt-c-text-dark-2: rgba(235, 235, 235, .64)}:root{--color-background: var(--vt-c-white);--color-background-soft: var(--vt-c-white-soft);--color-background-mute: var(--vt-c-white-mute);--color-border: var(--vt-c-divider-light-2);--color-border-hover: var(--vt-c-divider-light-1);--color-heading: var(--vt-c-text-light-1);--color-text: var(--vt-c-text-light-1);--section-gap: 160px}@media (prefers-color-scheme: dark){:root{--color-background: var(--vt-c-black);--color-background-soft: var(--vt-c-black-soft);--color-background-mute: var(--vt-c-black-mute);--color-border: var(--vt-c-divider-dark-2);--color-border-hover: var(--vt-c-divider-dark-1);--color-heading: var(--vt-c-text-dark-1);--color-text: var(--vt-c-text-dark-2)}}*,*:before,*:after{box-sizing:border-box;margin:0;position:relative;font-weight:400}body{min-height:100vh;color:var(--color-text);background:var(--color-background);transition:color .5s,background-color .5s;line-height:1.6;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:15px;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.border{border-width:1px;border-style:solid;border-color:#000;border-radius:30px;padding:15px}#submitButton{background-color:#41b883;border-color:#41b883;border-radius:10px;border-style:solid;color:#fff;width:100%;height:40px}.errorMsg{font-weight:600;text-align:center;color:red;margin-top:5px;margin-bottom:0%}#app{max-width:1280px;margin:0 auto;padding:2rem;font-weight:400}header{line-height:1.5;max-height:100vh}.logo{display:block;margin:0 auto 2rem}a,.green{text-decoration:none;color:#00bd7e;transition:.4s}@media (hover: hover){a:hover{background-color:#00bd7e33}}nav{width:100%;font-size:12px;text-align:center;margin-top:2rem}nav a.router-link-exact-active{color:var(--color-text)}nav a.router-link-exact-active:hover{background-color:transparent}nav a{display:inline-block;padding:0 1rem;border-left:1px solid var(--color-border)}nav a:first-of-type{border:0}@media (min-width: 1024px){body{display:flex;place-items:center}#app{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem}header{display:flex;place-items:center;padding-right:calc(var(--section-gap) / 2)}header .wrapper{display:flex;place-items:flex-start;flex-wrap:wrap}.logo{margin:0 2rem 0 0}nav{text-align:left;margin-left:-1rem;font-size:1rem;padding:1rem 0;margin-top:1rem}}#loginLogo[data-v-2dcaf03b]{width:50%;display:block;margin-right:auto;margin-left:auto}#textAboveSignup[data-v-630eccfb]{font-size:80%}.borderProduct[data-v-7b61759a]{border-width:1px;border-style:solid;border-color:#000;border-radius:15px;padding:10px;margin:1%}
:root{--vt-c-white: #ffffff;--vt-c-white-soft: #f8f8f8;--vt-c-white-mute: #f2f2f2;--vt-c-black: #181818;--vt-c-black-soft: #222222;--vt-c-black-mute: #282828;--vt-c-indigo: #2c3e50;--vt-c-divider-light-1: rgba(60, 60, 60, .29);--vt-c-divider-light-2: rgba(60, 60, 60, .12);--vt-c-divider-dark-1: rgba(84, 84, 84, .65);--vt-c-divider-dark-2: rgba(84, 84, 84, .48);--vt-c-text-light-1: var(--vt-c-indigo);--vt-c-text-light-2: rgba(60, 60, 60, .66);--vt-c-text-dark-1: var(--vt-c-white);--vt-c-text-dark-2: rgba(235, 235, 235, .64)}:root{--color-background: var(--vt-c-white);--color-background-soft: var(--vt-c-white-soft);--color-background-mute: var(--vt-c-white-mute);--color-border: var(--vt-c-divider-light-2);--color-border-hover: var(--vt-c-divider-light-1);--color-heading: var(--vt-c-text-light-1);--color-text: var(--vt-c-text-light-1);--section-gap: 160px}@media (prefers-color-scheme: dark){:root{--color-background: var(--vt-c-black);--color-background-soft: var(--vt-c-black-soft);--color-background-mute: var(--vt-c-black-mute);--color-border: var(--vt-c-divider-dark-2);--color-border-hover: var(--vt-c-divider-dark-1);--color-heading: var(--vt-c-text-dark-1);--color-text: var(--vt-c-text-dark-2)}}*,*:before,*:after{box-sizing:border-box;margin:0;position:relative;font-weight:400}body{min-height:100vh;color:var(--color-text);background:var(--color-background);transition:color .5s,background-color .5s;line-height:1.6;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:15px;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.border{border-width:1px;border-style:solid;border-color:#000;border-radius:30px;padding:15px}#submitButton{background-color:#41b883;border-color:#41b883;border-radius:10px;border-style:solid;color:#fff;width:100%;height:40px}.errorMsg{font-weight:600;text-align:center;color:red;margin-top:5px;margin-bottom:0%}#app{max-width:1280px;margin:0 auto;padding:2rem;font-weight:400}header{line-height:1.5;max-height:100vh}.logo{display:block;margin:0 auto 2rem}a,.green{text-decoration:none;color:#00bd7e;transition:.4s}@media (hover: hover){a:hover{background-color:#00bd7e33}}nav{width:100%;font-size:12px;text-align:center;margin-top:2rem}nav a.router-link-exact-active{color:var(--color-text)}nav a.router-link-exact-active:hover{background-color:transparent}nav a{display:inline-block;padding:0 1rem;border-left:1px solid var(--color-border)}nav a:first-of-type{border:0}@media (min-width: 1024px){body{display:flex;place-items:center}#app{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem}header{display:flex;place-items:center;padding-right:calc(var(--section-gap) / 2)}header .wrapper{display:flex;place-items:flex-start;flex-wrap:wrap}.logo{margin:0 2rem 0 0}nav{text-align:left;margin-left:-1rem;font-size:1rem;padding:1rem 0;margin-top:1rem}}#loginLogo[data-v-2dcaf03b]{width:50%;display:block;margin-right:auto;margin-left:auto}#textAboveSignup[data-v-630eccfb]{font-size:80%}.borderProduct[data-v-647288e9]{border-width:1px;border-style:solid;border-color:#000;border-radius:15px;padding:10px;margin:1%}
import{o as i,c as a,a as e,b as u,u as v,R as $,w,d as M,F as h,e as C,f as _,v as m,t as g,g as P,p as L,h as x,r as b,i as R,j as V,k as S,l as E,m as O,n as F,q as T}from"./vendor.0c899232.js";const Q=function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))p(s);new MutationObserver(s=>{for(const n of s)if(n.type==="childList")for(const r of n.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&p(r)}).observe(document,{childList:!0,subtree:!0});function l(s){const n={};return s.integrity&&(n.integrity=s.integrity),s.referrerpolicy&&(n.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?n.credentials="include":s.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function p(s){if(s.ep)return;s.ep=!0;const n=l(s);fetch(s.href,n)}};Q();const j=C("Login"),B=C("Register"),D=C("Market"),A={setup(t){return(o,l)=>(i(),a(h,null,[e("header",null,[e("nav",null,[u(v($),{to:"/"},{default:w(()=>[j]),_:1}),u(v($),{to:"/register"},{default:w(()=>[B]),_:1}),u(v($),{to:"/market"},{default:w(()=>[D]),_:1})])]),u(v(M))],64))}};var J="/assets/loginLogo.4c8cccd3.png";var k=(t,o)=>{const l=t.__vccOpts||t;for(const[p,s]of o)l[p]=s;return l};const X={data(){return{dataLogin:{email:"",password:""},error:""}},methods:{submitLogin(){this.$http.post("http://localhost:3001/auth/login",this.dataLogin).then(t=>{t.data.success?this.$router.push({name:"market"}):this.error=t.data.error}).catch(t=>{console.log(t)})}}},f=t=>(L("data-v-2dcaf03b"),t=t(),x(),t),H=f(()=>e("link",{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css",integrity:"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T",crossorigin:"anonymous"},null,-1)),W={class:"border"},q=f(()=>e("img",{id:"loginLogo",src:J},null,-1)),Y={class:"form-group"},Z=f(()=>e("label",null,"Email",-1)),K=f(()=>e("p",null,null,-1)),z={class:"form-group"},G=f(()=>e("label",null,"Password",-1)),tt=f(()=>e("button",{id:"submitButton",type:"submit"},"Login",-1)),et={class:"errorMsg"};function st(t,o,l,p,s,n){return i(),a(h,null,[H,e("form",{method:"post",onSubmit:o[2]||(o[2]=P((...r)=>n.submitLogin&&n.submitLogin(...r),["prevent"]))},[e("div",W,[q,e("div",Y,[Z,_(e("input",{class:"form-control","onUpdate:modelValue":o[0]||(o[0]=r=>s.dataLogin.email=r),placeholder:"Enter Email"},null,512),[[m,s.dataLogin.email]]),K]),e("div",z,[G,_(e("input",{class:"form-control",type:"password","onUpdate:modelValue":o[1]||(o[1]=r=>s.dataLogin.password=r),placeholder:"Enter Password"},null,512),[[m,s.dataLogin.password]])]),tt,e("p",et,g(s.error),1)])],32)],64)}var ot=k(X,[["render",st],["__scopeId","data-v-2dcaf03b"]]);const rt={setup(t){return(o,l)=>(i(),a("main",null,[u(ot)]))}};const nt={data(){return{dataRegister:{email:"",username:"",firstName:"",lastName:"",password:"",repeatPassword:""},error:""}},methods:{submitRegister(){this.$http.post("http://localhost:3001/auth/register",this.dataRegister).then(t=>{console.log(t.data),t.data.success?this.$router.push({name:"login"}):this.error=t.data.error}).catch(t=>{console.log(t)})}}},d=t=>(L("data-v-630eccfb"),t=t(),x(),t),it=d(()=>e("link",{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css",integrity:"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T",crossorigin:"anonymous"},null,-1)),at={class:"border"},lt=d(()=>e("h2",null,"Sign Up",-1)),ct=d(()=>e("p",{id:"textAboveSignup"},"Please fill in the form to create an account",-1)),dt={class:"form-group"},ut=d(()=>e("label",null,"Email",-1)),pt={class:"form-group"},_t=d(()=>e("label",null,"Username",-1)),mt={class:"form-group"},ht=d(()=>e("label",null,"First Name",-1)),gt={class:"form-group"},ft=d(()=>e("label",null,"Last Name",-1)),yt={class:"form-group"},vt=d(()=>e("label",null,"Password",-1)),bt={class:"form-group"},kt=d(()=>e("label",null,"Repeat Password",-1)),$t=d(()=>e("button",{id:"submitButton",type:"submit"},"Sign Up",-1)),wt={class:"errorMsg"};function Rt(t,o,l,p,s,n){return i(),a(h,null,[it,e("form",{method:"post",onSubmit:o[6]||(o[6]=P((...r)=>n.submitRegister&&n.submitRegister(...r),["prevent"]))},[e("div",at,[lt,ct,e("div",dt,[ut,_(e("input",{class:"form-control",type:"email","onUpdate:modelValue":o[0]||(o[0]=r=>s.dataRegister.email=r),placeholder:"Enter Email"},null,512),[[m,s.dataRegister.email]])]),e("div",pt,[_t,_(e("input",{class:"form-control","onUpdate:modelValue":o[1]||(o[1]=r=>s.dataRegister.username=r),placeholder:"Username"},null,512),[[m,s.dataRegister.username]])]),e("div",mt,[ht,_(e("input",{class:"form-control","onUpdate:modelValue":o[2]||(o[2]=r=>s.dataRegister.firstName=r),placeholder:"First Name"},null,512),[[m,s.dataRegister.firstName]])]),e("div",gt,[ft,_(e("input",{class:"form-control","onUpdate:modelValue":o[3]||(o[3]=r=>s.dataRegister.lastName=r),placeholder:"Last Name"},null,512),[[m,s.dataRegister.lastName]])]),e("div",yt,[vt,_(e("input",{class:"form-control",type:"password","onUpdate:modelValue":o[4]||(o[4]=r=>s.dataRegister.password=r),placeholder:"Create your Password"},null,512),[[m,s.dataRegister.password]])]),e("div",bt,[kt,_(e("input",{class:"form-control",type:"password","onUpdate:modelValue":o[5]||(o[5]=r=>s.dataRegister.repeatPassword=r),placeholder:"Repeat your Password"},null,512),[[m,s.dataRegister.repeatPassword]])]),$t,e("p",wt,g(s.error),1)])],32)],64)}var Ct=k(nt,[["render",Rt],["__scopeId","data-v-630eccfb"]]);const Lt={setup(t){return(o,l)=>(i(),a("main",null,[u(Ct)]))}};const xt={data(){return{prices:[]}},props:{product:""},async created(){try{const t=await this.$http.get("http://localhost:3001/category/all");this.categories=t.data.data}catch(t){console.log(t)}}},y=t=>(L("data-v-647288e9"),t=t(),x(),t),It={class:"borderProduct"},Pt=y(()=>e("span",{class:"colorIdentifierFields"},"Name : ",-1)),Nt=y(()=>e("p",null,null,-1)),Ut=y(()=>e("span",{class:"colorIdentifierFields"},"Description : ",-1)),Mt=y(()=>e("p",null,null,-1)),Vt=y(()=>e("span",{class:"colorIdentifierFields"},"Url image : ",-1)),St={key:0};function Et(t,o,l,p,s,n){return i(),a("div",It,[Pt,e("span",null,g(l.product.title),1),Nt,Ut,e("span",null,g(l.product.desc),1),Mt,Vt,e("span",null,g(l.product.imageUrl),1),(i(!0),a(h,null,b(s.prices,r=>(i(),a("ul",{id:"prices",key:r._id},[r.product==l.product._id?(i(),a("li",St,g(r.price),1)):R("",!0)]))),128))])}var N=k(xt,[["render",Et],["__scopeId","data-v-647288e9"]]);const Ot={data(){return{categories:[],items:[],products:[],categoryClickedId:"",itemClickedId:""}},methods:{categoryClicked:function(t){this.categoryClickedId=t,this.itemClickedId=""},itemClicked:function(t){this.itemClickedId=t}},async created(){try{const t=await this.$http.get("http://localhost:3001/category/all");this.categories=t.data.data}catch(t){console.log(t)}try{const t=await this.$http.get("http://localhost:3001/item/all");this.items=t.data.data}catch(t){console.log(t)}try{const t=await this.$http.get("http://localhost:3001/product/all");this.products=t.data.data}catch(t){console.log(t)}},components:{Product:N}},Ft=e("div",{id:"app"},[e("h1",null,"MarketPlace")],-1),Tt=e("h2",null,"Categories",-1),Qt=["onClick"],jt=e("h2",null,"Items",-1),Bt=["onClick"],Dt=e("h2",null,"Products",-1),At={key:0};function Jt(t,o,l,p,s,n){const r=V("Product");return i(),a(h,null,[Ft,Tt,(i(!0),a(h,null,b(s.categories,c=>(i(),a("ul",{id:"categories",key:c._id},[e("li",{onClick:U=>n.categoryClicked(c._id)},g(c.name),9,Qt)]))),128)),jt,(i(!0),a(h,null,b(s.items,c=>(i(),a("ul",{id:"items",key:c._id},[c.category==this.categoryClickedId?(i(),a("li",{key:0,onClick:U=>n.itemClicked(c._id)},g(c.name),9,Bt)):R("",!0)]))),128)),Dt,(i(!0),a(h,null,b(s.products,c=>(i(),a("ul",{key:c._id},[c.item==this.itemClickedId?(i(),a("li",At,[u(r,{product:c},null,8,["product"])])):R("",!0)]))),128))],64)}var Xt=k(Ot,[["render",Jt]]);const Ht={setup(t){return(o,l)=>(i(),a("main",null,[u(Xt)]))}},Wt={setup(t){return(o,l)=>(i(),a("main",null,[u(N)]))}},qt=S({history:E("/"),routes:[{path:"/",name:"login",component:rt},{path:"/register",name:"register",component:Lt},{path:"/market",name:"market",component:Ht},{path:"/product",name:"product",component:Wt}]}),I=O(A);I.use(qt);I.use(F,T);I.mount("#app");
......@@ -5,9 +5,9 @@
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<script type="module" crossorigin src="/assets/index.1f943c88.js"></script>
<link rel="modulepreload" href="/assets/vendor.195d4a6b.js">
<link rel="stylesheet" href="/assets/index.e38d5bf7.css">
<script type="module" crossorigin src="/assets/index.a08365a9.js"></script>
<link rel="modulepreload" href="/assets/vendor.0c899232.js">
<link rel="stylesheet" href="/assets/index.96568644.css">
</head>
<body>
<div id="app"></div>
......
<script>
export default {
data() {
return {
prices: [],
};
},
props: {
product: "",
},
async created() {
try {
const resPrices = await this.$http.get(`http://localhost:3001/price/all`);
this.prices = resPrices.data.data;
}
catch (error) {
console.log(error);
}
}
}
</script>
<template>
<div class="borderProduct">
<span class="colorIdentifierFields">Name : </span><span>{{product.title}}</span>
......@@ -5,16 +28,15 @@
<span class="colorIdentifierFields">Description : </span><span>{{product.desc}}</span>
<p></p>
<span class="colorIdentifierFields">Url image : </span><span>{{product.imageUrl}}</span>
<ul id="prices" v-for="price of prices" :key="price._id">
<li v-if="price.product == product._id">
{{ price.price }}
</li>
</ul>
</div>
</template>
<script>
export default {
props: {
product: "",
}
}
</script>
<style scoped>
.borderProduct {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment