feat: Implement rest API endpoint to verify connection

This commit is contained in:
Faruk AYDIN
2024-08-27 14:48:12 +03:00
parent 77246c1fde
commit 1a833aad52
6 changed files with 120 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
import { renderObject } from '../../../../helpers/renderer.js';
export default async (request, response) => {
let connection = await request.currentUser
.$relatedQuery('connections')
.findOne({
id: request.params.connectionId,
})
.throwIfNotFound();
connection = await connection.verifyAndUpdateConnection();
renderObject(response, connection);
};