Fix errors
This commit is contained in:
@@ -226,6 +226,10 @@ export const updateRelationshipStatus = async (
|
||||
throw new Error('Relationship not found');
|
||||
}
|
||||
const relationship = relationships[0] as Relationship;
|
||||
// Everything above is just getting info
|
||||
if (userId === relationship.requestorId) {
|
||||
throw new Error('The requestor cannot accept the relationship they requested.');
|
||||
}
|
||||
if (status === 'accepted') {
|
||||
await db.update(schema.relationships)
|
||||
.set({ isAccepted: true })
|
||||
|
Reference in New Issue
Block a user