1 line
3.2 KiB
JavaScript
1 line
3.2 KiB
JavaScript
"use strict";(()=>{var e={};e.id=291,e.ids=[291],e.modules={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,o){return o in r?r[o]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,o)):"function"==typeof r&&"default"===o?r:void 0}}})},7808:(e,r,o)=>{o.r(r),o.d(r,{config:()=>c,default:()=>D,routeModule:()=>d});var s={};o.r(s),o.d(s,{default:()=>u});var n=o(89947),t=o(2706),i=o(96762),a=o(48786),_=o(69842);async function u(e,r){if("POST"!==e.method)return r.json({msg:"Failed!"});let o=await (0,_.A)(e,r,!0);if(!o)return r.json({success:!1,msg:"Unauthorized"});await (0,a.A)("DELETE FROM invitations WHERE id = ? AND inviting_user_id = ?",[e.body.id,o.id]),r.json({success:!0})}let D=(0,i.M)(s,"default"),c=(0,i.M)(s,"config"),d=new n.PagesAPIRouteModule({definition:{kind:t.A.PAGES_API,page:"/api/deleteInvitation",pathname:"/api/deleteInvitation",bundlePath:"",filename:""},userland:s})},69842:(e,r,o)=>{async function s(e,r,o){return Object(function(){var e=Error("Cannot find module '@moduletrace/datasquirel/dist/users/user-auth'");throw e.code="MODULE_NOT_FOUND",e}())({req:e,level:o?"deep":void 0}).payload}o.d(r,{A:()=>s}),function(){var e=Error("Cannot find module '@moduletrace/datasquirel/dist/users/user-auth'");throw e.code="MODULE_NOT_FOUND",e}()},48786:(e,r,o)=>{o.d(r,{A:()=>n});var s=o(7447);async function n(...e){let r=(0,s.A)();try{if(!r)throw Error("No Connection provided to DB_HANDLER function!");let o=await r.query(...e);return JSON.parse(JSON.stringify(o))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}finally{await r?.end()}}},7447:(e,r,o)=>{o.d(r,{A:()=>t});var s=o(9973),n=o.n(s);function t(e){return global.DSQL_USE_LOCAL||e?.local?global.DSQL_DB_CONN||n()({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"}}):e?.ro?global.DSQL_READ_ONLY_DB_CONN||n()({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||n()({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||n()({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 o}});var o=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,o)=>{e.exports=o(75600)}};var r=require("../../webpack-api-runtime.js");r.C(e);var o=r(r.s=7808);module.exports=o})(); |