forked from SoDOff-Project/sodoff
more friendly response for profile not found
This commit is contained in:
parent
31a985334d
commit
e88a5db3bf
@ -23,8 +23,11 @@ public class ProfileController : Controller {
|
||||
// NOTE: this is public info (for mmo) - no session check
|
||||
|
||||
Viking? viking = ctx.Vikings.FirstOrDefault(e => e.Id == userId);
|
||||
if (viking is null)
|
||||
return Conflict("Viking not found");
|
||||
if (viking is null) {
|
||||
return Ok(new UserProfileData());
|
||||
// NOTE: do not return `Conflict("Viking not found")` due to client side error handling
|
||||
// (not Ok response cause soft-lock client - can't close error message)
|
||||
}
|
||||
|
||||
return Ok(GetProfileDataFromViking(viking));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user