Skip to content

Commit

Permalink
YKI(Frontend): Fix broken isRegistrationInitErrorResponse(..) guard […
Browse files Browse the repository at this point in the history
…deploy]
  • Loading branch information
pkoivisto committed Mar 12, 2024
1 parent bc1c6c2 commit 978fe23
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions frontend/packages/yki/src/interfaces/publicRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,8 @@ export function isRegistrationInitErrorResponse(
if (!error) {
return false;
}
const { closed, full, registered } = error;
if (typeof closed !== 'boolean' || typeof closed !== 'undefined') {
return false;
}
if (typeof full !== 'boolean' || typeof full !== 'undefined') {
return false;
}
if (typeof registered !== 'boolean' || typeof registered !== 'undefined') {
return false;
}
if (
typeof closed === 'undefined' &&
typeof full === 'undefined' &&
typeof registered === 'undefined'
) {
return false;
}

return true;
return 'closed' in error || 'full' in error || 'exists' in error;
}

export interface PublicRegistrationFormSubmitErrorResponse {
Expand Down

0 comments on commit 978fe23

Please sign in to comment.