Un-nest a switch

This commit is contained in:
Asher 2020-02-06 14:00:38 -06:00
parent 63f3c04c57
commit 26f8216ec8
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
1 changed files with 9 additions and 10 deletions

View File

@ -39,16 +39,15 @@ export class ApiHttpProvider extends HttpProvider {
return this.login(request)
}
break
default:
if (!this.authenticated(request)) {
return { code: HttpCode.Unauthorized }
}
switch (route.base) {
case ApiEndpoint.applications:
return this.applications()
case ApiEndpoint.files:
return this.files()
}
}
if (!this.authenticated(request)) {
return { code: HttpCode.Unauthorized }
}
switch (route.base) {
case ApiEndpoint.applications:
return this.applications()
case ApiEndpoint.files:
return this.files()
}
return undefined
}