From 72358836466a62b39705ce994ac2e22929fceda6 Mon Sep 17 00:00:00 2001 From: omkieit Date: Fri, 25 Oct 2024 11:26:04 +0530 Subject: [PATCH] done --- ef-ui/dist/assets/{index-CVyH-t6Z.js => index-CkItAeVW.js} | 2 +- ef-ui/dist/index.html | 2 +- ef-ui/src/redux/features/propertySlice.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename ef-ui/dist/assets/{index-CVyH-t6Z.js => index-CkItAeVW.js} (99%) diff --git a/ef-ui/dist/assets/index-CVyH-t6Z.js b/ef-ui/dist/assets/index-CkItAeVW.js similarity index 99% rename from ef-ui/dist/assets/index-CVyH-t6Z.js rename to ef-ui/dist/assets/index-CkItAeVW.js index 39d34eb..535805e 100644 --- a/ef-ui/dist/assets/index-CVyH-t6Z.js +++ b/ef-ui/dist/assets/index-CkItAeVW.js @@ -50,7 +50,7 @@ Error generating stack: `+i.message+` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const o=new this(t);return n.forEach(s=>o.set(s)),o}static accessor(t){const o=(this[rp]=this[rp]={accessors:{}}).accessors,s=this.prototype;function i(a){const l=Ro(a);o[l]||(P0(s,a),o[l]=!0)}return z.isArray(t)?t.forEach(i):i(t),this}}at.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);z.reduceDescriptors(at.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}});z.freezeMethods(at);function Hl(e,t){const n=this||Os,o=t||n,s=at.from(o.headers);let i=o.data;return z.forEach(e,function(l){i=l.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Nv(e){return!!(e&&e.__CANCEL__)}function mo(e,t,n){se.call(this,e??"canceled",se.ERR_CANCELED,t,n),this.name="CanceledError"}z.inherits(mo,se,{__CANCEL__:!0});function Cv(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new se("Request failed with status code "+n.status,[se.ERR_BAD_REQUEST,se.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function _0(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function O0(e,t){e=e||10;const n=new Array(e),o=new Array(e);let s=0,i=0,a;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),d=o[i];a||(a=c),n[s]=u,o[s]=c;let f=i,g=0;for(;f!==s;)g+=n[f++],f=f%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-a{n=d,s=null,i&&(clearTimeout(i),i=null),e.apply(null,c)};return[(...c)=>{const d=Date.now(),f=d-n;f>=o?a(c,d):(s=c,i||(i=setTimeout(()=>{i=null,a(s)},o-f)))},()=>s&&a(s)]}const la=(e,t,n=3)=>{let o=0;const s=O0(50,250);return T0(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,u=a-o,c=s(u),d=a<=l;o=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:u,rate:c||void 0,estimated:c&&l&&d?(l-a)/c:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},op=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},sp=e=>(...t)=>z.asap(()=>e(...t)),R0=it.hasStandardBrowserEnv?function(){const t=it.navigator&&/(msie|trident)/i.test(it.navigator.userAgent),n=document.createElement("a");let o;function s(i){let a=i;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return o=s(window.location.href),function(a){const l=z.isString(a)?s(a):a;return l.protocol===o.protocol&&l.host===o.host}}():function(){return function(){return!0}}(),A0=it.hasStandardBrowserEnv?{write(e,t,n,o,s,i){const a=[e+"="+encodeURIComponent(t)];z.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),z.isString(o)&&a.push("path="+o),z.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function I0(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function D0(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function bv(e,t){return e&&!I0(t)?D0(e,t):t}const ip=e=>e instanceof at?{...e}:e;function Cr(e,t){t=t||{};const n={};function o(c,d,f){return z.isPlainObject(c)&&z.isPlainObject(d)?z.merge.call({caseless:f},c,d):z.isPlainObject(d)?z.merge({},d):z.isArray(d)?d.slice():d}function s(c,d,f){if(z.isUndefined(d)){if(!z.isUndefined(c))return o(void 0,c,f)}else return o(c,d,f)}function i(c,d){if(!z.isUndefined(d))return o(void 0,d)}function a(c,d){if(z.isUndefined(d)){if(!z.isUndefined(c))return o(void 0,c)}else return o(void 0,d)}function l(c,d,f){if(f in t)return o(c,d);if(f in e)return o(void 0,c)}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(c,d)=>s(ip(c),ip(d),!0)};return z.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=u[d]||s,g=f(e[d],t[d],d);z.isUndefined(g)&&f!==l||(n[d]=g)}),n}const wv=e=>{const t=Cr({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:l}=t;t.headers=a=at.from(a),t.url=xv(bv(t.baseURL,t.url),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(z.isFormData(n)){if(it.hasStandardBrowserEnv||it.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[c,...d]=u?u.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...d].join("; "))}}if(it.hasStandardBrowserEnv&&(o&&z.isFunction(o)&&(o=o(t)),o||o!==!1&&R0(t.url))){const c=s&&i&&A0.read(i);c&&a.set(s,c)}return t},F0=typeof XMLHttpRequest<"u",M0=F0&&function(e){return new Promise(function(n,o){const s=wv(e);let i=s.data;const a=at.from(s.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:c}=s,d,f,g,b,x;function N(){b&&b(),x&&x(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let C=new XMLHttpRequest;C.open(s.method.toUpperCase(),s.url,!0),C.timeout=s.timeout;function m(){if(!C)return;const h=at.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:h,config:e,request:C};Cv(function(T){n(T),N()},function(T){o(T),N()},k),C=null}"onloadend"in C?C.onloadend=m:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(m)},C.onabort=function(){C&&(o(new se("Request aborted",se.ECONNABORTED,e,C)),C=null)},C.onerror=function(){o(new se("Network Error",se.ERR_NETWORK,e,C)),C=null},C.ontimeout=function(){let y=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||yv;s.timeoutErrorMessage&&(y=s.timeoutErrorMessage),o(new se(y,k.clarifyTimeoutError?se.ETIMEDOUT:se.ECONNABORTED,e,C)),C=null},i===void 0&&a.setContentType(null),"setRequestHeader"in C&&z.forEach(a.toJSON(),function(y,k){C.setRequestHeader(k,y)}),z.isUndefined(s.withCredentials)||(C.withCredentials=!!s.withCredentials),l&&l!=="json"&&(C.responseType=s.responseType),c&&([g,x]=la(c,!0),C.addEventListener("progress",g)),u&&C.upload&&([f,b]=la(u),C.upload.addEventListener("progress",f),C.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(d=h=>{C&&(o(!h||h.type?new mo(null,e,C):h),C.abort(),C=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const v=_0(s.url);if(v&&it.protocols.indexOf(v)===-1){o(new se("Unsupported protocol "+v+":",se.ERR_BAD_REQUEST,e));return}C.send(i||null)})},L0=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,s;const i=function(c){if(!s){s=!0,l();const d=c instanceof Error?c:this.reason;o.abort(d instanceof se?d:new mo(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,i(new se(`timeout ${t} of ms exceeded`,se.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:u}=o;return u.unsubscribe=()=>z.asap(l),u}},B0=function*(e,t){let n=e.byteLength;if(!t||n{const s=z0(e,t);let i=0,a,l=u=>{a||(a=!0,o&&o(u))};return new ReadableStream({async pull(u){try{const{done:c,value:d}=await s.next();if(c){l(),u.close();return}let f=d.byteLength;if(n){let g=i+=f;n(g)}u.enqueue(new Uint8Array(d))}catch(c){throw l(c),c}},cancel(u){return l(u),s.return()}},{highWaterMark:2})},Ua=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Sv=Ua&&typeof ReadableStream=="function",W0=Ua&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),kv=(e,...t)=>{try{return!!e(...t)}catch{return!1}},U0=Sv&&kv(()=>{let e=!1;const t=new Request(it.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),lp=64*1024,ou=Sv&&kv(()=>z.isReadableStream(new Response("").body)),ca={stream:ou&&(e=>e.body)};Ua&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ca[t]&&(ca[t]=z.isFunction(e[t])?n=>n[t]():(n,o)=>{throw new se(`Response type '${t}' is not supported`,se.ERR_NOT_SUPPORT,o)})})})(new Response);const q0=async e=>{if(e==null)return 0;if(z.isBlob(e))return e.size;if(z.isSpecCompliantForm(e))return(await new Request(it.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(z.isArrayBufferView(e)||z.isArrayBuffer(e))return e.byteLength;if(z.isURLSearchParams(e)&&(e=e+""),z.isString(e))return(await W0(e)).byteLength},V0=async(e,t)=>{const n=z.toFiniteNumber(e.getContentLength());return n??q0(t)},H0=Ua&&(async e=>{let{url:t,method:n,data:o,signal:s,cancelToken:i,timeout:a,onDownloadProgress:l,onUploadProgress:u,responseType:c,headers:d,withCredentials:f="same-origin",fetchOptions:g}=wv(e);c=c?(c+"").toLowerCase():"text";let b=L0([s,i&&i.toAbortSignal()],a),x;const N=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let C;try{if(u&&U0&&n!=="get"&&n!=="head"&&(C=await V0(d,o))!==0){let k=new Request(t,{method:"POST",body:o,duplex:"half"}),P;if(z.isFormData(o)&&(P=k.headers.get("content-type"))&&d.setContentType(P),k.body){const[T,O]=op(C,la(sp(u)));o=ap(k.body,lp,T,O)}}z.isString(f)||(f=f?"include":"omit");const m="credentials"in Request.prototype;x=new Request(t,{...g,signal:b,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:o,duplex:"half",credentials:m?f:void 0});let v=await fetch(x);const h=ou&&(c==="stream"||c==="response");if(ou&&(l||h&&N)){const k={};["status","statusText","headers"].forEach(M=>{k[M]=v[M]});const P=z.toFiniteNumber(v.headers.get("content-length")),[T,O]=l&&op(P,la(sp(l),!0))||[];v=new Response(ap(v.body,lp,T,()=>{O&&O(),N&&N()}),k)}c=c||"text";let y=await ca[z.findKey(ca,c)||"text"](v,e);return!h&&N&&N(),await new Promise((k,P)=>{Cv(k,P,{data:y,headers:at.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:x})})}catch(m){throw N&&N(),m&&m.name==="TypeError"&&/fetch/i.test(m.message)?Object.assign(new se("Network Error",se.ERR_NETWORK,e,x),{cause:m.cause||m}):se.from(m,m&&m.code,e,x)}}),su={http:a0,xhr:M0,fetch:H0};z.forEach(su,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const cp=e=>`- ${e}`,K0=e=>z.isFunction(e)||e===null||e===!1,Ev={getAdapter:e=>{e=z.isArray(e)?e:[e];const{length:t}=e;let n,o;const s={};for(let i=0;i`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since : `+i.map(cp).join(` `):" "+cp(i[0]):"as no adapter specified";throw new se("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o},adapters:su};function Kl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new mo(null,e)}function up(e){return Kl(e),e.headers=at.from(e.headers),e.data=Hl.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ev.getAdapter(e.adapter||Os.adapter)(e).then(function(o){return Kl(e),o.data=Hl.call(e,e.transformResponse,o),o.headers=at.from(o.headers),o},function(o){return Nv(o)||(Kl(e),o&&o.response&&(o.response.data=Hl.call(e,e.transformResponse,o.response),o.response.headers=at.from(o.response.headers))),Promise.reject(o)})}const Pv="1.7.7",yd={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{yd[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const dp={};yd.transitional=function(t,n,o){function s(i,a){return"[Axios v"+Pv+"] Transitional option '"+i+"'"+a+(o?". "+o:"")}return(i,a,l)=>{if(t===!1)throw new se(s(a," has been removed"+(n?" in "+n:"")),se.ERR_DEPRECATED);return n&&!dp[a]&&(dp[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,l):!0}};function Y0(e,t,n){if(typeof e!="object")throw new se("options must be an object",se.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let s=o.length;for(;s-- >0;){const i=o[s],a=t[i];if(a){const l=e[i],u=l===void 0||a(l,i,e);if(u!==!0)throw new se("option "+i+" must be "+u,se.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new se("Unknown option "+i,se.ERR_BAD_OPTION)}}const iu={assertOptions:Y0,validators:yd},yn=iu.validators;class fr{constructor(t){this.defaults=t,this.interceptors={request:new np,response:new np}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{o.stack?i&&!String(o.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(o.stack+=` -`+i):o.stack=i}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Cr(this.defaults,n);const{transitional:o,paramsSerializer:s,headers:i}=n;o!==void 0&&iu.assertOptions(o,{silentJSONParsing:yn.transitional(yn.boolean),forcedJSONParsing:yn.transitional(yn.boolean),clarifyTimeoutError:yn.transitional(yn.boolean)},!1),s!=null&&(z.isFunction(s)?n.paramsSerializer={serialize:s}:iu.assertOptions(s,{encode:yn.function,serialize:yn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&z.merge(i.common,i[n.method]);i&&z.forEach(["delete","get","head","post","put","patch","common"],x=>{delete i[x]}),n.headers=at.concat(a,i);const l=[];let u=!0;this.interceptors.request.forEach(function(N){typeof N.runWhen=="function"&&N.runWhen(n)===!1||(u=u&&N.synchronous,l.unshift(N.fulfilled,N.rejected))});const c=[];this.interceptors.response.forEach(function(N){c.push(N.fulfilled,N.rejected)});let d,f=0,g;if(!u){const x=[up.bind(this),void 0];for(x.unshift.apply(x,l),x.push.apply(x,c),g=x.length,d=Promise.resolve(n);f{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](s);o._listeners=null}),this.promise.then=s=>{let i;const a=new Promise(l=>{o.subscribe(l),i=l}).then(s);return a.cancel=function(){o.unsubscribe(i)},a},t(function(i,a,l){o.reason||(o.reason=new mo(i,a,l),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new jd(function(s){t=s}),cancel:t}}}function G0(e){return function(n){return e.apply(null,n)}}function Q0(e){return z.isObject(e)&&e.isAxiosError===!0}const au={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(au).forEach(([e,t])=>{au[t]=e});function _v(e){const t=new fr(e),n=iv(fr.prototype.request,t);return z.extend(n,fr.prototype,t,{allOwnKeys:!0}),z.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return _v(Cr(e,s))},n}const he=_v(Os);he.Axios=fr;he.CanceledError=mo;he.CancelToken=jd;he.isCancel=Nv;he.VERSION=Pv;he.toFormData=Wa;he.AxiosError=se;he.Cancel=he.CanceledError;he.all=function(t){return Promise.all(t)};he.spread=G0;he.isAxiosError=Q0;he.mergeConfig=Cr;he.AxiosHeaders=at;he.formToJSON=e=>jv(z.isHTMLForm(e)?new FormData(e):e);he.getAdapter=Ev.getAdapter;he.HttpStatusCode=au;he.default=he;const X0="http://67.225.129.127:3002",mn=he.create({baseURL:X0});mn.interceptors.request.use(e=>(localStorage.getItem("profile")&&(e.headers.Authorization=`Bearer ${JSON.parse(localStorage.getItem("profile")).token}`),e));const J0=e=>mn.post("/users/signup",e),Z0=e=>mn.post("/users/signin",e),eN=(e,t,n)=>mn.get(`/users/${e}/verify/${t}`,n),tN=e=>mn.post("/properties",e),nN=(e,t,n)=>mn.get(`/properties/user/${e}?page=${t}&limit=${n}`,e),rN=e=>mn.get(`/properties/${e}`,e),oN=(e,t)=>mn.put(`/properties/${e}`,t),sN=e=>mn.get(`/users/${e}`),iN="http://67.225.129.127:3002",ji=yt("auth/login",async({formValue:e,navigate:t},{rejectWithValue:n})=>{try{const o=await Z0(e);return t("/dashboard"),o.data}catch(o){return n(o.response.data)}}),Ni=yt("auth/register",async({formValue:e,navigate:t,toast:n},{rejectWithValue:o})=>{try{const s=await J0(e);return console.log("response",s),n.success("Register Successfully"),t("/registrationsuccess"),s.data}catch(s){return o(s.response.data)}}),Ci=yt("auth/updateUser",async({formData:e,toast:t,navigate:n},{rejectWithValue:o})=>{try{const s=await he.put(`${iN}/users/update`,e);return t.success("Updated Successfully"),n("/login"),s.data}catch(s){return o(s.response.data)}}),Ov=La({name:"auth",initialState:{user:null,error:"",loading:!1,isLoading:!1},reducers:{setUser:(e,t)=>{e.user=t.payload},setLogout:e=>{localStorage.clear(),e.user=null},setUserDetails:(e,t)=>{e.user=t.payload},updateUser:(e,t)=>{const n=t.payload;e.user={...e.user,...n}}},extraReducers:e=>{e.addCase(ji.pending,t=>{t.loading=!0}).addCase(ji.fulfilled,(t,n)=>{t.loading=!1,localStorage.setItem("profile",JSON.stringify({...n.payload})),t.user=n.payload}).addCase(ji.rejected,(t,n)=>{t.loading=!1,t.error=n.payload.message}).addCase(Ni.pending,t=>{t.loading=!0}).addCase(Ni.fulfilled,(t,n)=>{t.loading=!1,localStorage.setItem("profile",JSON.stringify({...n.payload})),t.user=n.payload}).addCase(Ni.rejected,(t,n)=>{t.loading=!1,t.error=n.payload.message}).addCase(Ci.pending,t=>{t.isLoading=!0}).addCase(Ci.fulfilled,(t,n)=>{t.isLoading=!1,t.user=n.payload}).addCase(Ci.rejected,(t,n)=>{t.isLoading=!1,t.error=n.payload})}}),{setUser:Qw,setLogout:aN,setUserDetails:Xw}=Ov.actions,lN=Ov.reducer,bi=yt("user/showUser",async(e,{rejectWithValue:t})=>{try{return(await sN(e)).data}catch(n){return t(n.response.data)}}),wi=yt("user/verifyEmail",async({id:e,token:t,data:n},{rejectWithValue:o})=>{try{return(await eN(e,t,n)).data.message}catch(s){return o(s.response.data)}}),cN=La({name:"user",initialState:{users:[],error:"",loading:!1,verified:!1,user:{}},reducers:{},extraReducers:e=>{e.addCase(bi.pending,t=>{t.loading=!0,t.error=null}).addCase(bi.fulfilled,(t,n)=>{t.loading=!1,t.user=n.payload}).addCase(bi.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}).addCase(wi.pending,t=>{t.loading=!0,t.error=null}).addCase(wi.fulfilled,(t,n)=>{t.loading=!1,t.verified=n.payload==="Email verified successfully"}).addCase(wi.rejected,(t,n)=>{t.loading=!1,t.error=n.error.message})}}),uN=cN.reducer,Si=yt("property/submitProperty",async(e,{rejectWithValue:t})=>{try{return(await tN(e)).data}catch(n){return t(n.response.data)}}),ki=yt("property/fetchUserProperties",async({userId:e,page:t,limit:n},{rejectWithValue:o})=>{try{return(await nN(e,t,n)).data}catch(s){return o(s.response.data)}}),Go=yt("property/fetchPropertyById",async(e,{rejectWithValue:t})=>{try{return(await rN(e)).data}catch(n){return t(n.response.data)}}),Ei=yt("property/updateProperty",async({id:e,propertyData:t},{rejectWithValue:n})=>{try{return(await oN(e,t)).data}catch(o){return n(o.response.data)}}),Pi=yt("property/addFundDetails",async({id:e,fundDetails:t,toast:n},{rejectWithValue:o})=>{try{const s=await he.put(`http://67.225.129.127:3002/properties/${e}/fund-details`,t);return n.success("Submitted Successfully"),s.data}catch(s){return o(s.response.data)}}),_i=yt("property/deleteFundDetail",async({id:e,fundDetailId:t,token:n},{rejectWithValue:o})=>{try{return(await he.delete(`http://localhost:3002/properties/${e}/fund-details/${t}`,{headers:{Authorization:`Bearer ${n}`}})).data}catch(s){return o(s.response.data)}}),Qo=yt("properties/getProperties",async({page:e,limit:t,keyword:n=""})=>(await he.get(`http://67.225.129.127:3002/properties?page=${e}&limit=${t}&keyword=${n}`)).data),dN=La({name:"property",initialState:{property:{},status:"idle",error:null,userProperties:[],selectedProperty:null,totalPages:0,currentPage:1,loading:!1,properties:[],fundDetails:[]},reducers:{},extraReducers:e=>{e.addCase(Si.pending,t=>{t.status="loading"}).addCase(Si.fulfilled,(t,n)=>{t.status="succeeded",t.property=n.payload}).addCase(Si.rejected,(t,n)=>{t.status="failed",t.error=n.payload}).addCase(ki.pending,t=>{t.loading=!0}).addCase(ki.fulfilled,(t,{payload:n})=>{t.loading=!1,t.userProperties=n.properties,t.totalPages=n.totalPages,t.currentPage=n.currentPage}).addCase(ki.rejected,(t,{payload:n})=>{t.loading=!1,t.error=n}).addCase(Go.pending,t=>{t.status="loading"}).addCase(Go.fulfilled,(t,n)=>{t.status="succeeded",t.selectedProperty=n.payload}).addCase(Go.rejected,(t,n)=>{t.status="failed",t.error=n.payload}).addCase(Ei.pending,t=>{t.status="loading"}).addCase(Ei.fulfilled,(t,n)=>{t.status="succeeded",t.selectedProperty=n.payload}).addCase(Ei.rejected,(t,n)=>{t.status="failed",t.error=n.payload}).addCase(Qo.pending,t=>{t.loading=!0}).addCase(Qo.fulfilled,(t,n)=>{t.loading=!1,t.properties=n.payload.data,t.totalPages=n.payload.totalPages,t.currentPage=n.payload.currentPage}).addCase(Qo.rejected,(t,n)=>{t.loading=!1,t.error=n.error.message}).addCase(Pi.pending,t=>{t.loading=!0}).addCase(Pi.fulfilled,(t,n)=>{t.loading=!1,t.property=n.payload.property}).addCase(Pi.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}).addCase(_i.pending,t=>{t.loading=!0}).addCase(_i.fulfilled,(t,n)=>{t.loading=!1,t.fundDetails=t.fundDetails.filter(o=>o._id!==n.meta.arg.id)}).addCase(_i.rejected,(t,n)=>{t.loading=!1,t.error=n.payload})}}),fN=dN.reducer,Yl=yt("fundDetails/fetchFundDetails",async(e,{rejectWithValue:t})=>{try{return(await he.get(`http://67.225.129.127:3002/properties/${e}/fund-details`)).data.fundDetails}catch(n){return t(n.response.data)}}),pN=La({name:"fundDetails",initialState:{fundDetails:[],loading:!1,error:null},reducers:{},extraReducers:e=>{e.addCase(Yl.pending,t=>{t.loading=!0}).addCase(Yl.fulfilled,(t,n)=>{t.loading=!1,t.fundDetails=n.payload}).addCase(Yl.rejected,(t,n)=>{t.loading=!1,t.error=n.payload})}}),mN=pN.reducer,hN=n1({reducer:{auth:lN,user:uN,property:fN,fundDetails:mN}});/** +`+i):o.stack=i}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Cr(this.defaults,n);const{transitional:o,paramsSerializer:s,headers:i}=n;o!==void 0&&iu.assertOptions(o,{silentJSONParsing:yn.transitional(yn.boolean),forcedJSONParsing:yn.transitional(yn.boolean),clarifyTimeoutError:yn.transitional(yn.boolean)},!1),s!=null&&(z.isFunction(s)?n.paramsSerializer={serialize:s}:iu.assertOptions(s,{encode:yn.function,serialize:yn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&z.merge(i.common,i[n.method]);i&&z.forEach(["delete","get","head","post","put","patch","common"],x=>{delete i[x]}),n.headers=at.concat(a,i);const l=[];let u=!0;this.interceptors.request.forEach(function(N){typeof N.runWhen=="function"&&N.runWhen(n)===!1||(u=u&&N.synchronous,l.unshift(N.fulfilled,N.rejected))});const c=[];this.interceptors.response.forEach(function(N){c.push(N.fulfilled,N.rejected)});let d,f=0,g;if(!u){const x=[up.bind(this),void 0];for(x.unshift.apply(x,l),x.push.apply(x,c),g=x.length,d=Promise.resolve(n);f{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](s);o._listeners=null}),this.promise.then=s=>{let i;const a=new Promise(l=>{o.subscribe(l),i=l}).then(s);return a.cancel=function(){o.unsubscribe(i)},a},t(function(i,a,l){o.reason||(o.reason=new mo(i,a,l),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new jd(function(s){t=s}),cancel:t}}}function G0(e){return function(n){return e.apply(null,n)}}function Q0(e){return z.isObject(e)&&e.isAxiosError===!0}const au={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(au).forEach(([e,t])=>{au[t]=e});function _v(e){const t=new fr(e),n=iv(fr.prototype.request,t);return z.extend(n,fr.prototype,t,{allOwnKeys:!0}),z.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return _v(Cr(e,s))},n}const he=_v(Os);he.Axios=fr;he.CanceledError=mo;he.CancelToken=jd;he.isCancel=Nv;he.VERSION=Pv;he.toFormData=Wa;he.AxiosError=se;he.Cancel=he.CanceledError;he.all=function(t){return Promise.all(t)};he.spread=G0;he.isAxiosError=Q0;he.mergeConfig=Cr;he.AxiosHeaders=at;he.formToJSON=e=>jv(z.isHTMLForm(e)?new FormData(e):e);he.getAdapter=Ev.getAdapter;he.HttpStatusCode=au;he.default=he;const X0="http://67.225.129.127:3002",mn=he.create({baseURL:X0});mn.interceptors.request.use(e=>(localStorage.getItem("profile")&&(e.headers.Authorization=`Bearer ${JSON.parse(localStorage.getItem("profile")).token}`),e));const J0=e=>mn.post("/users/signup",e),Z0=e=>mn.post("/users/signin",e),eN=(e,t,n)=>mn.get(`/users/${e}/verify/${t}`,n),tN=e=>mn.post("/properties",e),nN=(e,t,n)=>mn.get(`/properties/user/${e}?page=${t}&limit=${n}`,e),rN=e=>mn.get(`/properties/${e}`,e),oN=(e,t)=>mn.put(`/properties/${e}`,t),sN=e=>mn.get(`/users/${e}`),iN="http://67.225.129.127:3002",ji=yt("auth/login",async({formValue:e,navigate:t},{rejectWithValue:n})=>{try{const o=await Z0(e);return t("/dashboard"),o.data}catch(o){return n(o.response.data)}}),Ni=yt("auth/register",async({formValue:e,navigate:t,toast:n},{rejectWithValue:o})=>{try{const s=await J0(e);return console.log("response",s),n.success("Register Successfully"),t("/registrationsuccess"),s.data}catch(s){return o(s.response.data)}}),Ci=yt("auth/updateUser",async({formData:e,toast:t,navigate:n},{rejectWithValue:o})=>{try{const s=await he.put(`${iN}/users/update`,e);return t.success("Updated Successfully"),n("/login"),s.data}catch(s){return o(s.response.data)}}),Ov=La({name:"auth",initialState:{user:null,error:"",loading:!1,isLoading:!1},reducers:{setUser:(e,t)=>{e.user=t.payload},setLogout:e=>{localStorage.clear(),e.user=null},setUserDetails:(e,t)=>{e.user=t.payload},updateUser:(e,t)=>{const n=t.payload;e.user={...e.user,...n}}},extraReducers:e=>{e.addCase(ji.pending,t=>{t.loading=!0}).addCase(ji.fulfilled,(t,n)=>{t.loading=!1,localStorage.setItem("profile",JSON.stringify({...n.payload})),t.user=n.payload}).addCase(ji.rejected,(t,n)=>{t.loading=!1,t.error=n.payload.message}).addCase(Ni.pending,t=>{t.loading=!0}).addCase(Ni.fulfilled,(t,n)=>{t.loading=!1,localStorage.setItem("profile",JSON.stringify({...n.payload})),t.user=n.payload}).addCase(Ni.rejected,(t,n)=>{t.loading=!1,t.error=n.payload.message}).addCase(Ci.pending,t=>{t.isLoading=!0}).addCase(Ci.fulfilled,(t,n)=>{t.isLoading=!1,t.user=n.payload}).addCase(Ci.rejected,(t,n)=>{t.isLoading=!1,t.error=n.payload})}}),{setUser:Qw,setLogout:aN,setUserDetails:Xw}=Ov.actions,lN=Ov.reducer,bi=yt("user/showUser",async(e,{rejectWithValue:t})=>{try{return(await sN(e)).data}catch(n){return t(n.response.data)}}),wi=yt("user/verifyEmail",async({id:e,token:t,data:n},{rejectWithValue:o})=>{try{return(await eN(e,t,n)).data.message}catch(s){return o(s.response.data)}}),cN=La({name:"user",initialState:{users:[],error:"",loading:!1,verified:!1,user:{}},reducers:{},extraReducers:e=>{e.addCase(bi.pending,t=>{t.loading=!0,t.error=null}).addCase(bi.fulfilled,(t,n)=>{t.loading=!1,t.user=n.payload}).addCase(bi.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}).addCase(wi.pending,t=>{t.loading=!0,t.error=null}).addCase(wi.fulfilled,(t,n)=>{t.loading=!1,t.verified=n.payload==="Email verified successfully"}).addCase(wi.rejected,(t,n)=>{t.loading=!1,t.error=n.error.message})}}),uN=cN.reducer,Si=yt("property/submitProperty",async(e,{rejectWithValue:t})=>{try{return(await tN(e)).data}catch(n){return t(n.response.data)}}),ki=yt("property/fetchUserProperties",async({userId:e,page:t,limit:n},{rejectWithValue:o})=>{try{return(await nN(e,t,n)).data}catch(s){return o(s.response.data)}}),Go=yt("property/fetchPropertyById",async(e,{rejectWithValue:t})=>{try{return(await rN(e)).data}catch(n){return t(n.response.data)}}),Ei=yt("property/updateProperty",async({id:e,propertyData:t},{rejectWithValue:n})=>{try{return(await oN(e,t)).data}catch(o){return n(o.response.data)}}),Pi=yt("property/addFundDetails",async({id:e,fundDetails:t,toast:n},{rejectWithValue:o})=>{try{const s=await he.put(`http://67.225.129.127:3002/properties/${e}/fund-details`,t);return n.success("Submitted Successfully"),s.data}catch(s){return o(s.response.data)}}),_i=yt("property/deleteFundDetail",async({id:e,fundDetailId:t,token:n},{rejectWithValue:o})=>{try{return(await he.delete(`http://67.225.129.127:3002/properties/${e}/fund-details/${t}`,{headers:{Authorization:`Bearer ${n}`}})).data}catch(s){return o(s.response.data)}}),Qo=yt("properties/getProperties",async({page:e,limit:t,keyword:n=""})=>(await he.get(`http://67.225.129.127:3002/properties?page=${e}&limit=${t}&keyword=${n}`)).data),dN=La({name:"property",initialState:{property:{},status:"idle",error:null,userProperties:[],selectedProperty:null,totalPages:0,currentPage:1,loading:!1,properties:[],fundDetails:[]},reducers:{},extraReducers:e=>{e.addCase(Si.pending,t=>{t.status="loading"}).addCase(Si.fulfilled,(t,n)=>{t.status="succeeded",t.property=n.payload}).addCase(Si.rejected,(t,n)=>{t.status="failed",t.error=n.payload}).addCase(ki.pending,t=>{t.loading=!0}).addCase(ki.fulfilled,(t,{payload:n})=>{t.loading=!1,t.userProperties=n.properties,t.totalPages=n.totalPages,t.currentPage=n.currentPage}).addCase(ki.rejected,(t,{payload:n})=>{t.loading=!1,t.error=n}).addCase(Go.pending,t=>{t.status="loading"}).addCase(Go.fulfilled,(t,n)=>{t.status="succeeded",t.selectedProperty=n.payload}).addCase(Go.rejected,(t,n)=>{t.status="failed",t.error=n.payload}).addCase(Ei.pending,t=>{t.status="loading"}).addCase(Ei.fulfilled,(t,n)=>{t.status="succeeded",t.selectedProperty=n.payload}).addCase(Ei.rejected,(t,n)=>{t.status="failed",t.error=n.payload}).addCase(Qo.pending,t=>{t.loading=!0}).addCase(Qo.fulfilled,(t,n)=>{t.loading=!1,t.properties=n.payload.data,t.totalPages=n.payload.totalPages,t.currentPage=n.payload.currentPage}).addCase(Qo.rejected,(t,n)=>{t.loading=!1,t.error=n.error.message}).addCase(Pi.pending,t=>{t.loading=!0}).addCase(Pi.fulfilled,(t,n)=>{t.loading=!1,t.property=n.payload.property}).addCase(Pi.rejected,(t,n)=>{t.loading=!1,t.error=n.payload}).addCase(_i.pending,t=>{t.loading=!0}).addCase(_i.fulfilled,(t,n)=>{t.loading=!1,t.fundDetails=t.fundDetails.filter(o=>o._id!==n.meta.arg.id)}).addCase(_i.rejected,(t,n)=>{t.loading=!1,t.error=n.payload})}}),fN=dN.reducer,Yl=yt("fundDetails/fetchFundDetails",async(e,{rejectWithValue:t})=>{try{return(await he.get(`http://67.225.129.127:3002/properties/${e}/fund-details`)).data.fundDetails}catch(n){return t(n.response.data)}}),pN=La({name:"fundDetails",initialState:{fundDetails:[],loading:!1,error:null},reducers:{},extraReducers:e=>{e.addCase(Yl.pending,t=>{t.loading=!0}).addCase(Yl.fulfilled,(t,n)=>{t.loading=!1,t.fundDetails=n.payload}).addCase(Yl.rejected,(t,n)=>{t.loading=!1,t.error=n.payload})}}),mN=pN.reducer,hN=n1({reducer:{auth:lN,user:uN,property:fN,fundDetails:mN}});/** * @remix-run/router v1.19.1 * * Copyright (c) Remix Software Inc. diff --git a/ef-ui/dist/index.html b/ef-ui/dist/index.html index 25ee5ec..ea23ab2 100644 --- a/ef-ui/dist/index.html +++ b/ef-ui/dist/index.html @@ -45,7 +45,7 @@ - + diff --git a/ef-ui/src/redux/features/propertySlice.js b/ef-ui/src/redux/features/propertySlice.js index 0dd82fe..a4a48d2 100644 --- a/ef-ui/src/redux/features/propertySlice.js +++ b/ef-ui/src/redux/features/propertySlice.js @@ -88,7 +88,7 @@ export const deleteFundDetail = createAsyncThunk( // console.log("Token received:", token, fundDetailId, id); try { const response = await axios.delete( - `http://localhost:3002/properties/${id}/fund-details/${fundDetailId}`, + `${import.meta.env.VITE_REACT_APP_SECRET}/properties/${id}/fund-details/${fundDetailId}`, { headers: { Authorization: `Bearer ${token}`, // Use the token passed in as a parameter