day 11
This commit is contained in:
Executable
Executable
+32
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* links Resolve Deactivate
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { formatError } = require('../../utils/formatError');
|
||||
|
||||
module.exports = async (_, __, { db, user }) => {
|
||||
try {
|
||||
const previousLinks = await db.link.getAll({ user_id: user.id, status: 1 });
|
||||
if (previousLinks?.length) {
|
||||
await db.link.update(
|
||||
{ status: 0 },
|
||||
{
|
||||
where: { id: previousLinks?.map((link) => link.id) },
|
||||
},
|
||||
);
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
message: 'All links deactivated successfully.',
|
||||
};
|
||||
} catch (error) {
|
||||
return formatError(error);
|
||||
}
|
||||
};
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* activity_log Resolve Delete
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { ApolloError } = require('apollo-server-express');
|
||||
|
||||
module.exports = async (parent, args, {db}, info) => {
|
||||
//Check Auth if user allowed
|
||||
try {
|
||||
|
||||
return await db.activity_log.realDelete(args.id);
|
||||
} catch (error) {
|
||||
console.log('delete_activity_log -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* calendar Resolve Delete
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { ApolloError } = require('apollo-server-express');
|
||||
|
||||
module.exports = async (parent, args, {db}, info) => {
|
||||
//Check Auth if user allowed
|
||||
try {
|
||||
|
||||
return await db.calendar.realDelete(args.id);
|
||||
} catch (error) {
|
||||
console.log('delete_calendar -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* code Resolve Delete
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { ApolloError } = require('apollo-server-express');
|
||||
|
||||
module.exports = async (parent, args, {db}, info) => {
|
||||
//Check Auth if user allowed
|
||||
try {
|
||||
|
||||
return await db.code.realDelete(args.id);
|
||||
} catch (error) {
|
||||
console.log('delete_code -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* credential Resolve Delete
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { ApolloError } = require('apollo-server-express');
|
||||
|
||||
module.exports = async (parent, args, {db}, info) => {
|
||||
//Check Auth if user allowed
|
||||
try {
|
||||
|
||||
return await db.credential.realDelete(args.id);
|
||||
} catch (error) {
|
||||
console.log('delete_credential -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* image Resolve Delete
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { ApolloError } = require('apollo-server-express');
|
||||
|
||||
module.exports = async (parent, args, {db}, info) => {
|
||||
//Check Auth if user allowed
|
||||
try {
|
||||
|
||||
return await db.image.realDelete(args.id);
|
||||
} catch (error) {
|
||||
console.log('delete_image -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* link Resolve Delete
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { ApolloError } = require('apollo-server-express');
|
||||
|
||||
module.exports = async (parent, args, {db}, info) => {
|
||||
//Check Auth if user allowed
|
||||
try {
|
||||
|
||||
return await db.link.realDelete(args.id);
|
||||
} catch (error) {
|
||||
console.log('delete_link -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* note Resolve Delete
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { ApolloError } = require('apollo-server-express');
|
||||
|
||||
module.exports = async (parent, args, {db}, info) => {
|
||||
//Check Auth if user allowed
|
||||
try {
|
||||
|
||||
return await db.note.realDelete(args.id);
|
||||
} catch (error) {
|
||||
console.log('delete_note -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* profile Resolve Delete
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { ApolloError } = require('apollo-server-express');
|
||||
|
||||
module.exports = async (parent, args, {db}, info) => {
|
||||
//Check Auth if user allowed
|
||||
try {
|
||||
|
||||
return await db.profile.realDelete(args.id);
|
||||
} catch (error) {
|
||||
console.log('delete_profile -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* refer_log Resolve Delete
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { ApolloError } = require('apollo-server-express');
|
||||
|
||||
module.exports = async (parent, args, {db}, info) => {
|
||||
//Check Auth if user allowed
|
||||
try {
|
||||
|
||||
return await db.refer_log.realDelete(args.id);
|
||||
} catch (error) {
|
||||
console.log('delete_refer_log -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* user Resolve Delete
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { ApolloError } = require('apollo-server-express');
|
||||
|
||||
module.exports = async (parent, args, {db}, info) => {
|
||||
//Check Auth if user allowed
|
||||
try {
|
||||
|
||||
return await db.user.realDelete(args.id);
|
||||
} catch (error) {
|
||||
console.log('delete_user -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user