Skip to content

Commit 240d028

Browse files
committed
Delete shared devices on reject connection
1 parent 0abde76 commit 240d028

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/controllers/connectionController.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ export const rejectConnectionRequest = async (
135135
},
136136
})
137137

138+
// Delete associated shared devices
139+
await prisma.deviceShare.deleteMany({
140+
where: {
141+
connection_id: updatedConnection.id,
142+
},
143+
})
144+
138145
res.status(200).json({ connection: sanitizeData(updatedConnection) })
139146
} catch (error) {
140147
console.error(error)

0 commit comments

Comments
 (0)