I believe most errors are fixed. Rewrite is basically complete

This commit is contained in:
2024-10-21 12:32:53 -05:00
parent 2e36b01266
commit 3f477e8dfb
4 changed files with 14 additions and 11 deletions

View File

@ -134,6 +134,10 @@ export const updateRelationshipStatus = async (userId: number, status: 'accepted
}),
});
if (!response.ok) {
if (status === 'rejected') {
console.log('Relationship deleted.');
return null;
}
throw new Error(
`Error updating relationship status: ${response.status} ${response.statusText}`
);