chore: Do not override query method for findOne query errors
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
3e4768c106
commit
79b12ac9e6
@@ -10,7 +10,7 @@ const createAuthDataResolver = async (params: Params, req: RequestWithCurrentUse
|
||||
const connection = await Connection.query().findOne({
|
||||
user_id: req.currentUser.id,
|
||||
id: params.id
|
||||
})
|
||||
}).throwIfNotFound();
|
||||
|
||||
const appClass = (await import(`../../apps/${connection.key}`)).default;
|
||||
|
||||
|
@@ -16,7 +16,7 @@ const createStepResolver = async (params: Params, req: RequestWithCurrentUser) =
|
||||
const flow = await Flow.query().findOne({
|
||||
id: params.flowId,
|
||||
user_id: req.currentUser.id
|
||||
})
|
||||
}).throwIfNotFound();
|
||||
|
||||
const step = await Step.query().insertAndFetch({
|
||||
flowId: flow.id,
|
||||
|
@@ -10,7 +10,7 @@ const deleteConnectionResolver = async (params: Params, req: RequestWithCurrentU
|
||||
await Connection.query().delete().findOne({
|
||||
user_id: req.currentUser.id,
|
||||
id: params.id
|
||||
})
|
||||
}).throwIfNotFound();
|
||||
|
||||
return;
|
||||
}
|
||||
|
@@ -12,11 +12,11 @@ type Params = {
|
||||
const executeStepResolver = async (params: Params, req: RequestWithCurrentUser) => {
|
||||
let step = await Step.query().findOne({
|
||||
id: params.id
|
||||
})
|
||||
}).throwIfNotFound();
|
||||
|
||||
let connection = await Connection.query().findOne({
|
||||
id: step.connectionId
|
||||
})
|
||||
}).throwIfNotFound();
|
||||
|
||||
const appClass = (await import(`../../apps/${step.appKey}`)).default;
|
||||
const appInstance = new appClass(connection.data);
|
||||
|
@@ -11,7 +11,7 @@ const resetConnectionResolver = async (params: Params, req: RequestWithCurrentUs
|
||||
let connection = await Connection.query().findOne({
|
||||
user_id: req.currentUser.id,
|
||||
id: params.id
|
||||
})
|
||||
}).throwIfNotFound();
|
||||
|
||||
connection = await connection.$query().patchAndFetch({
|
||||
data: { screenName: connection.data.screenName }
|
||||
|
@@ -12,7 +12,7 @@ const updateConnectionResolver = async (params: Params, req: RequestWithCurrentU
|
||||
let connection = await Connection.query().findOne({
|
||||
user_id: req.currentUser.id,
|
||||
id: params.id
|
||||
})
|
||||
}).throwIfNotFound();
|
||||
|
||||
connection = await connection.$query().patchAndFetch({
|
||||
data: {
|
||||
|
@@ -10,7 +10,7 @@ const verifyConnectionResolver = async (params: Params, req: RequestWithCurrentU
|
||||
let connection = await Connection.query().findOne({
|
||||
user_id: req.currentUser.id,
|
||||
id: params.id
|
||||
})
|
||||
}).throwIfNotFound();
|
||||
|
||||
const appClass = (await import(`../../apps/${connection.key}`)).default;
|
||||
|
||||
|
@@ -11,7 +11,7 @@ const testConnectionResolver = async (params: Params, req: RequestWithCurrentUse
|
||||
let connection = await Connection.query().findOne({
|
||||
user_id: req.currentUser.id,
|
||||
id: params.id
|
||||
})
|
||||
}).throwIfNotFound();
|
||||
|
||||
const appClass = (await import(`../../apps/${connection.key}`)).default;
|
||||
|
||||
|
Reference in New Issue
Block a user