completionId: cgen-12f192c2ab954e7ba0ad78e56a5cd757
cgen-12f192c2ab954e7ba0ad78e56a5cd757
This commit is contained in:
parent
a5f4eabd3d
commit
80a6963dc4
1 changed files with 5 additions and 1 deletions
|
|
@ -255,7 +255,11 @@ export async function updateApplicationStatus(
|
||||||
.eq("user_id", userId)
|
.eq("user_id", userId)
|
||||||
.single();
|
.single();
|
||||||
|
|
||||||
if (creator?.id !== application.aethex_opportunities.posted_by_id) {
|
const opportunityData = Array.isArray(application.aethex_opportunities)
|
||||||
|
? application.aethex_opportunities[0]
|
||||||
|
: application.aethex_opportunities;
|
||||||
|
|
||||||
|
if (creator?.id !== opportunityData?.posted_by_id) {
|
||||||
return new Response(JSON.stringify({ error: "Unauthorized" }), {
|
return new Response(JSON.stringify({ error: "Unauthorized" }), {
|
||||||
status: 403,
|
status: 403,
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue