refactor(reset-connection): streamline patches

This commit is contained in:
Ali BARIN
2024-08-29 08:05:49 +00:00
parent 0eb906d5df
commit e7474dcb9e

View File

@@ -8,12 +8,10 @@ export default async (request, response) => {
})
.throwIfNotFound();
if (!connection.formattedData) {
return renderObject(response, connection);
}
connection = await connection.$query().patchAndFetch({
formattedData: { screenName: connection.formattedData.screenName },
formattedData: connection?.formattedData?.screenName
? { screenName: connection.formattedData.screenName }
: null,
});
renderObject(response, connection);