refactor: Remove redundant getAppConnections query

This commit is contained in:
Faruk AYDIN
2022-07-26 23:42:00 +03:00
parent 18cdd226bb
commit cb26948db6
3 changed files with 0 additions and 30 deletions

View File

@@ -1,27 +0,0 @@
import App from '../../models/app';
import Context from '../../types/express/context';
type Params = {
key: string;
};
const getAppConnections = async (
_parent: unknown,
params: Params,
context: Context
) => {
const app = App.findOneByKey(params.key);
const connections = await context.currentUser
.$relatedQuery('connections')
.where({
key: params.key,
});
return connections.map((connection) => ({
...connection,
app,
}));
};
export default getAppConnections;