mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(federation): ✨ Handle instances not existing
This commit is contained in:
parent
deee65ad6d
commit
91da99c934
4 changed files with 33 additions and 9 deletions
|
|
@ -106,6 +106,13 @@ export default apiRoute((app) =>
|
|||
// Try to fetch it from database
|
||||
const instance = await Instance.resolveFromHost(instanceHost);
|
||||
|
||||
if (!instance) {
|
||||
return context.json(
|
||||
{ error: `Instance ${instanceHost} not found` },
|
||||
404,
|
||||
);
|
||||
}
|
||||
|
||||
const account = await User.fromSql(
|
||||
and(
|
||||
eq(Users.username, username),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue