{"version":3,"file":"0l6D-XEB.js","sources":["../../../../src/composables/useUser.ts"],"sourcesContent":["import {USERS_SERVICE} from \"~/data/ServicesConstants\";\nimport type {User} from \"~/models/services/User\";\n\nexport const useUser = () => {\n const getUserDetails = async () => {\n return await (await useNuxtApp().$getApi(USERS_SERVICE)).get('/users/current-user')\n }\n const showUser = async (user_id: any) => {\n return await (await useNuxtApp().$getApi(USERS_SERVICE)).get(`/users/${user_id}`)\n }\n const updateProfileImage = async (image: File) => {\n const formData: FormData = new FormData()\n formData.append('profile_picture', image)\n\n return await (await useNuxtApp().$getApi(USERS_SERVICE)).post(`/users/profile-picture`, formData, {\n headers: {\n 'Content-Type': 'multipart/form-data'\n }\n })\n }\n const updateProfile = async (data: User) => {\n return await (await useNuxtApp().$getApi(USERS_SERVICE)).put(`/users/profile`, data)\n }\n\n return {\n getUserDetails,\n updateProfileImage,\n updateProfile,\n showUser\n }\n}"],"names":["useUser","useNuxtApp","USERS_SERVICE","image","formData","data","user_id"],"mappings":"0CAGO,MAAMA,EAAU,KAqBZ,CACH,eArBmB,SACZ,MAAO,MAAMC,IAAa,QAAQC,CAAa,GAAG,IAAI,qBAAqB,EAqBlF,mBAhBuB,MAAOC,GAAgB,CACxC,MAAAC,EAAqB,IAAI,SACtB,OAAAA,EAAA,OAAO,kBAAmBD,CAAK,EAEjC,MAAO,MAAMF,EAAW,EAAE,QAAQC,CAAa,GAAG,KAAK,yBAA0BE,EAAU,CAC9F,QAAS,CACL,eAAgB,qBACpB,CAAA,CACH,CAAA,EASD,cAPkB,MAAOC,GAClB,MAAO,MAAMJ,EAAW,EAAE,QAAQC,CAAa,GAAG,IAAI,iBAAkBG,CAAI,EAOnF,SArBa,MAAOC,GACb,MAAO,MAAML,EAAa,EAAA,QAAQC,CAAa,GAAG,IAAI,UAAUI,CAAO,EAAE,CAoBhF"}