mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-27 22:24:14 +00:00
Merge pull request #39 from Y4ELX/fix-infinite-loading-missing-resources
fix: handle not found errors for Mii and User in API responses
This commit is contained in:
commit
7f87a42b11
4 changed files with 8 additions and 0 deletions
|
|
@ -34,5 +34,7 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
|
|||
},
|
||||
});
|
||||
|
||||
if (!mii) return NextResponse.json({ error: "Mii not found" }, { status: 404 });
|
||||
|
||||
return NextResponse.json(mii);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,5 +21,7 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
|
|||
},
|
||||
});
|
||||
|
||||
if (!user) return NextResponse.json({ error: "User not found" }, { status: 404 });
|
||||
|
||||
return NextResponse.json(user);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue