feat: refactor verify connection mutation with the REST API endpoint
This commit is contained in:

committed by
Ali BARIN

parent
dc0273148c
commit
4d5fc50f1a
@@ -1,8 +1,3 @@
|
||||
// Converted mutations
|
||||
import verifyConnection from './mutations/verify-connection.js';
|
||||
|
||||
const mutationResolvers = {
|
||||
verifyConnection,
|
||||
};
|
||||
const mutationResolvers = {};
|
||||
|
||||
export default mutationResolvers;
|
||||
|
@@ -1,29 +0,0 @@
|
||||
import App from '../../models/app.js';
|
||||
import globalVariable from '../../helpers/global-variable.js';
|
||||
|
||||
const verifyConnection = async (_parent, params, context) => {
|
||||
context.currentUser.can('create', 'Connection');
|
||||
|
||||
let connection = await context.currentUser
|
||||
.$relatedQuery('connections')
|
||||
.findOne({
|
||||
id: params.input.id,
|
||||
})
|
||||
.throwIfNotFound();
|
||||
|
||||
const app = await App.findOneByKey(connection.key);
|
||||
const $ = await globalVariable({ connection, app });
|
||||
await app.auth.verifyCredentials($);
|
||||
|
||||
connection = await connection.$query().patchAndFetch({
|
||||
verified: true,
|
||||
draft: false,
|
||||
});
|
||||
|
||||
return {
|
||||
...connection,
|
||||
app,
|
||||
};
|
||||
};
|
||||
|
||||
export default verifyConnection;
|
@@ -3,7 +3,7 @@ type Query {
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
verifyConnection(input: VerifyConnectionInput): Connection
|
||||
placeholderQuery(name: String): Boolean
|
||||
}
|
||||
|
||||
type Trigger {
|
||||
@@ -184,10 +184,6 @@ type SamlAuthProvidersRoleMapping {
|
||||
remoteRoleName: String
|
||||
}
|
||||
|
||||
input VerifyConnectionInput {
|
||||
id: String!
|
||||
}
|
||||
|
||||
input UserRoleInput {
|
||||
id: String
|
||||
}
|
||||
|
Reference in New Issue
Block a user