PageSourceSearch

https://radon.vercel.app/_next/static/chunks/pages/admin/update-product/[id]-71fdd22ed524b5313fab.js

js radon.vercel.app collected 2026-10-03 07:35:06 UTC 4,135 bytes, 1 lines download raw bytes

1_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[31],{"20a2":function(e,t,r){e.exports=r("nOHt")},"Nv/r":function(e,t,r){"use strict";r.r(t),r.d(t,"__N_SSG",(function(){return b}));var n=r("nKUr"),o=r("q1tI"),a=r("vDqi"),i=r.n(a),d=r("20a2"),c=r("xnJ+"),l=r("eIyy"),u=r("g4pe"),s=r.n(u);function p(e){var t,r,a,u,p,b=Object(o.useState)(null===e||void 0===e||null===(t=e.product)||void 0===t?void 0:t.title),g=b[0],v=b[1],m=Object(o.useState)(null===e||void 0===e||null===(r=e.product)||void 0===r?void 0:r.description),j=m[0],x=m[1],h=Object(o.useState)(null===e||void 0===e||null===(a=e.product)||void 0===a?void 0:a.price),y=h[0],O=h[1],f=Object(o.useState)(null===e||void 0===e||null===(u=e.product)||void 0===u?void 0:u.image),N=f[0],_=f[1],w=Object(o.useState)(null===e||void 0===e||null===(p=e.product)||void 0===p?void 0:p.category),S=w[0],q=w[1],P=Object(d.useRouter)(),C=Object(c.a)(null===e||void 0===e?void 0:e.categories),U=C.categories,E=C.error,z=Object(o.useState)(!1),D=z[0],F=z[1];E&&console.error(E);return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(s.a,{children:Object(n.jsx)("title",{children:"Radon | Update Product"})}),Object(n.jsx)("div",{className:"heightFixAdmin px-6 lg:py-20 sm:py-16 py-12",children:Object(n.jsxs)("div",{className:"mx-auto max-w-screen-sm sm:text-base  text-sm",children:[Object(n.jsx)("h2",{className:"lg:text-4xl sm:text-3xl text-2xl  font-bold mb-6",children:"Update Product"}),Object(n.jsxs)("form",{onSubmit:function(e){e.preventDefault(),F(!0),i.a.post("/api/admin/update-product",{_id:P.query.id,title:g,category:S,description:j,price:y,image:N}).then((function(e){Object(l.a)("Updated successfully"),F(!1)})).catch((function(e){Object(l.a)("Something went wrong",e),console.error(e),F(!1)}))},className:"flex flex-col gap-4",children:[Object(n.jsx)("input",{type:"text",required:!0,value:g,placeholder:"Title",className:"bg-gray-100 border border-gray-200 py-2 px-4 rounded-md outline-none",onChange:function(e){return v(e.target.value)},disabled:D}),Object(n.jsx)("select",{required:!0,className:"bg-gray-100 border border-gray-200 py-2 px-4 rounded-md outline-none capitalize",onChange:function(e){return q(e.target.value)},disabled:D,children:null===U||void 0===U?void 0:U.map((function(e){return Object(n.jsx)("option",{value:null===e||void 0===e?void 0:e.name,children:null===e||void 0===e?void 0:e.name},"option-".concat(null===e||void 0===e?void 0:e._id))}))}),Object(n.jsx)("textarea",{required:!0,placeholder:"Description",className:"bg-gray-100 py-2 px-4  border border-gray-200 rounded-md h-24 resize-none outline-none",value:j,onChange:function(e){return x(e.target.value)},cols:"25",rows:"10",disabled:D}),Object(n.jsx)("input",{type:"number",required:!0,placeholder:"Price",className:"bg-gray-100 py-2 border border-gray-200 px-4 rounded-md outline-none",value:y,onChange:function(e){return O(e.target.value)},disabled:D}),Object(n.jsx)("input",{type:"text",required:!0,placeholder:"Image Url",className:"bg-gray-100 py-2 px-4 border border-gray-200 rounded-md outline-none",value:N,onChange:function(e){return _(e.target.value)},disabled:D}),Object(n.jsx)("button",{type:"submit",className:"button py-2 px-10 sm:text-base text-sm mt-4 ".concat(D?"opacity-50":""),disabled:D,children:"Submit"})]})]})})]})}p.admin=!0;var b=!0;t.default=p},R9Lz:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/update-product/[id]",function(){return r("Nv/r")}])},eIyy:function(e,t,r){"use strict";var n=r("nKUr"),o=r("FGyW");t.a=function(e,t){Object(o.b)(Object(n.jsx)("div",{className:"font-medium",children:Object(n.jsx)("span",{className:"".concat(t?"text-red-500":""),children:e})}),{position:"top-right",autoClose:4e3,style:{background:"white",color:"#1f2937",fontFamily:"Poppins, sans-serif",height:"auto"},hideProgressBar:!0,pauseOnHover:!1,draggable:!0,draggablePercent:25})}},"xnJ+":function(e,t,r){"use strict";var n=r("VtrM");t.a=function(e){var t;return{categories:(t=e?Object(n.b)("/api/categories",{initialData:e}):Object(n.b)("/api/categories")).data,isLoading:!t.error&&!t.data,error:t.error}}}},[["R9Lz",0,1,2,3,4,7,6]]]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.