"use strict";(()=>{var e={};e.id=291,e.ids=[291],e.modules={39908:e=>{e.exports=require("@moduletrace/datasquirel/dist/users/user-auth")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,n){return n in r?r[n]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,n)):"function"==typeof r&&"default"===n?r:void 0}}})},7808:(e,r,n)=>{n.r(r),n.d(r,{config:()=>d,default:()=>c,routeModule:()=>D});var s={};n.r(s),n.d(s,{default:()=>_});var t=n(89947),o=n(2706),i=n(96762),a=n(48786),u=n(69842);async function _(e,r){if("POST"!==e.method)return r.json({msg:"Failed!"});let n=await (0,u.A)(e,r,!0);if(!n)return r.json({success:!1,msg:"Unauthorized"});await (0,a.A)("DELETE FROM invitations WHERE id = ? AND inviting_user_id = ?",[e.body.id,n.id]),r.json({success:!0})}let c=(0,i.M)(s,"default"),d=(0,i.M)(s,"config"),D=new t.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/deleteInvitation",pathname:"/api/deleteInvitation",bundlePath:"",filename:""},userland:s})},69842:(e,r,n)=>{n.d(r,{A:()=>o});var s=n(39908),t=n.n(s);async function o(e,r,n){let s=t()({req:e,level:n?"deep":void 0});return console.log(s),s.payload}},48786:(e,r,n)=>{n.d(r,{A:()=>t});var s=n(7447);async function t(...e){let r=(0,s.A)();try{if(!r)throw Error("No Connection provided to DB_HANDLER function!");let n=await r.query(...e);return JSON.parse(JSON.stringify(n))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}finally{await r?.end()}}},7447:(e,r,n)=>{n.d(r,{A:()=>o});var s=n(9973),t=n.n(s);function o(e){return e?.ro?DSQL_READ_ONLY_DB_CONN||t()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.fa?global.DSQL_FULL_ACCESS_DB_CONN||t()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_FULL_ACCESS_USERNAME,password:process.env.DSQL_DB_FULL_ACCESS_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):global.DSQL_DB_CONN||t()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}})}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return n}});var n=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,r,n)=>{e.exports=n(75600)}};var r=require("../../webpack-api-runtime.js");r.C(e);var n=r(r.s=7808);module.exports=n})();