PageSourceSearch

https://www.filetico.com/_next/static/chunks/pages/admin/crud/[slug]-a47047ebf2e656fa.js

js filetico.com collected 2026-10-02 00:50:40 UTC 6,910 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4460],{53128:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/crud/[slug]",function(){return t(56945)}])},71075:function(e,s,t){"use strict";var a=t(85893),r=t(67294),l=t(11163),n=t.n(l),o=t(36115);s.Z=e=>{let{children:s}=e;return(0,r.useEffect)(()=>{(0,o.$D)()?1!==(0,o.$D)().role&&n().push("/"):n().push("/signin")},[]),(0,a.jsx)(r.Fragment,{children:s})}},38417:function(e,s,t){"use strict";var a=t(85893);t(41664);var r=t(67294),l=t(11163),n=t.n(l),o=t(5152),i=t.n(o),c=t(36115),d=t(89955),u=t(10613),h=t(3153);t(37676);var m=t(36814);t(45289),t(22920);var x=t(63197);let g=i()(()=>Promise.all([t.e(2937),t.e(1167)]).then(t.t.bind(t,71167,23)),{loadableGenerated:{webpack:()=>[71167]},ssr:!1});s.Z=(0,l.withRouter)(e=>{let{router:s}=e,[t,l]=(0,r.useState)(!1),[o,i]=(0,r.useState)("<p></p>"),[p,j]=(0,r.useState)(""),[f,v]=(0,r.useState)(""),[N,_]=(0,r.useState)(""),[b,y]=(0,r.useState)([]),[C,D]=(0,r.useState)([]),[O,E]=(0,r.useState)([]),[T,w]=(0,r.useState)([]),[S,P]=(0,r.useState)([]),[k,$]=(0,r.useState)({title:"",titlet:"",error:"",sizeError:"",success:"",formData:new FormData,lng:"*",autor:"",spotify:"",cantante:"",options:["PENDING_MODERATION","PUBLISHED","NOT_APPROVED"],status:"",not_approved_reason:"",loading:!1}),{error:A,success:I,formData:q,title:F,titlet:R,lng:Z,autor:z,spotify:B,cantante:G,loading:H}=k,M=(0,c.ej)("token");(0,r.useEffect)(()=>{$({...k,formData:new FormData}),s.query.slug&&(initBlog(),initCategories(),initTags())},[s.query.slug]);let initBlog=()=>{s.query.slug&&(0,h.Ch)(s.query.slug).then(e=>{e.error?console.log(e.error):($({...k,title:e.title,autor:e.autor,cantante:e.cantante,status:e.status,not_approved_reason:e.not_approved_reason}),i(e.body),v(e.status),setCategoriesArray(e.categories),q.set("title",e.title),q.set("body",e.body),q.set("autor",e.autor),q.set("cantante",e.cantante),q.set("status",e.status),q.set("not_approved_reason",e.not_approved_reason),_(e.not_approved_reason))})},setCategoriesArray=e=>{let s=[];e.map((e,t)=>{s.push(e._id)}),E(s)},initCategories=()=>{(0,d.Jt)().then(e=>{if(e.error)$({...k,error:e.error});else{let s=[];e.forEach(e=>{s.push({value:e.name})}),P(s)}})},initTags=()=>{(0,u.NJ)().then(e=>{e.error?$({...k,error:e.error}):D(e)})},handleToggle=e=>()=>{$({...k,error:""});let s=O.indexOf(e),t=[...O];-1===s?t.push(e):t.splice(s,1),E(t),q.set("categories",t)},handleTagsToggle=e=>()=>{$({...k,error:""}),console.log(e);let s=T.indexOf(e),t=[...T];console.log(s),-1===s?t.push(e):t.splice(s,1),w(t),q.set("tags",t)},findOutCategory=e=>{let s=O.indexOf(e);return -1!==s},findOutTag=e=>{let s=T.indexOf(e);return -1!==s},handleChange=e=>s=>{console.log(e);let t="photo"===e?s.target.files[0]:s.target.value;console.log(t),q.set(e,t),$({...k,[e]:t,formData:q,error:""})};return(0,r.useEffect)(()=>
1{l(!0)},[]),(0,a.jsx)("div",{className:"cotainer-fluid pb-5",children:(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("div",{className:"col-md-8",children:[(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),(0,h.zZ)(q,M,s.query.slug).then(e=>{e.error?$({...k,error:e.error}):($({...k,title:"",success:'Art\xedculo: "'.concat(e.totle,'" ha sido actualizada correctamente')}),(0,c.$D)()&&1===(0,c.$D)().role?n().replace("/admin"):(0,c.$D)()&&0===(0,c.$D)().role&&n().replace("/user"))})},children:[(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{className:"text-muted",children:"T\xedtulo"}),(0,a.jsx)("input",{type:"text",className:"form-control",value:F,onChange:handleChange("title")})]}),!!(t&&(0,c.$D)())&&1===(0,c.$D)().role&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"row g-3 align-items-center",children:(0,a.jsxs)("div",{class:"col-auto d-inline-flex",children:[(0,a.jsx)("label",{className:"text-danger",children:"Blog Status"}),(0,a.jsx)("select",{name:"selectedOstatusption",onChange:handleChange("status"),className:"form-select ".concat("PENDING_MODERATION"==k.status?" text-warning ":""," ").concat("PUBLISHED"===k.status?" text-success ":"NOT_APPROVED"===k.status?" text-danger":""),children:k.options.map(e=>e==k.status?(0,a.jsx)("option",{value:e,selected:!0,children:e}):(0,a.jsx)("option",{value:e,children:e}))})]})}),"NOT_APPROVED"==k.status?(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{className:"text-muted",children:"Motivo de rechazo"}),(0,a.jsx)("textarea",{style:{height:"300px"},type:"text",className:"form-control",onChange:handleChange("not_approved_reason"),children:k.not_approved_reason})]}):(0,a.jsx)(a.Fragment,{})]}),(0,a.jsx)("div",{className:"form-group pt-3",children:(0,a.jsx)(g,{modules:m.J,formats:m.$,value:o,placeholder:"Cuerpo de la noticia",onChange:e=>{console.log("e => ",e),i(e),q.set("body",e)}})}),(0,a.jsx)("div",{children:(0,a.jsx)("button",{type:"submit",className:"btn btn-primary",children:"Guardar Cambios"})})]}),(0,a.jsxs)("div",{className:"pt-3",children:[void 0,void 0]}),o&&(0,a.jsx)("img",{src:"".concat(x.bl,"/blog/photo/").concat(s.query.slug),alt:F,style:{width:"100%"}})]}),(0,a.jsxs)("div",{className:"col-md-4",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"form-group pb-2",children:[(0,a.jsx)("h5",{children:"Featured Image"}),(0,a.jsx)("hr",{}),(0,a.jsx)("small",{className:"text-muted",children:"Max size: 1mb"}),(0,a.jsx)("br",{}),(0,a.jsxs)("label",{className:"btn btn-outline-info",children:["Upload featured image",(0,a.jsx)("input",{onChange:handleChange("photo"),type:"file",accept:"image/*",hidden:!0})]})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{children:"Categories"}),(0,a.jsx)("hr",{}),(0,a.jsx)("ul",{style:{maxHeight:"200px",overflowY:"scroll"},children:b&&b.map((e,s)=>(0,a.jsxs)("li",{className:"list-unstyled",children:[(0,a.jsx)("input",{onChange:handleToggle(e._id),checked:findOutCategory(e._id),type:"checkbox",className:"mr-2"}),(0,a.jsx)("label",{className:"form-check.label",children:e.name})]},s))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{children:"Tags"}),(0,a.jsx)("hr",{}),(0,a.jsx)("ul",{style:{maxHeight:"200px",overflowY:"scroll"},children:C&&C.map((e,s)=>(0,a.jsxs)("li",{className:"list-unstyled",children:[(0,a.jsx)("input",{onChange:handleTagsToggle(e._id),checked:findOutTag(e._id),type:"checkbox",className:"mr-2"}),(0,a.jsx)("label",{className:"form-check.label",children:e.name})]},s))})]})]})]})})})},56945:function(e,s,t){"use strict";t.r(s);var a=t(85893),r=t(98980),l=t(71075),n=t(38417);t(41664),s.default=()=>(0,a.jsx)(r.Z,{children:(0,a.jsx)(l.Z,{children:(0,a.jsx)("div",{className:"container-fluid",children:(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{className:"col-md-12 pt-5 pb-5",children:(0,a.jsx)("h2",{children:"Update blog"})}),(0,a.jsx)("div",{className:"col-md-12",children:(0,a.jsx)(n.Z,{})})]})})})})}},function(e){e.O(0,[1664,7594,9613,9774,2888,179],function(){return e(e.s=53128)}),_N_E=e.O()}]);

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.