Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Commit

Permalink
Invert if
Browse files Browse the repository at this point in the history
  • Loading branch information
janaagaard75 committed Jul 7, 2019
1 parent 8fe1211 commit ea65bda
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/greet/greet.ts
Expand Up @@ -6,16 +6,16 @@ export async function greet(
request: HttpRequest
): Promise<any> {
const name = extractName(request);
if (name !== "") {
return {
body: "Hello " + name
};
} else {
if (name === "") {
return {
body: "Please pass a name on the query string or in the request body",
status: 400
};
}

return {
body: "Hello " + name
};
}

function extractName(request: HttpRequest): string {
Expand Down

0 comments on commit ea65bda

Please sign in to comment.