Skip to content

What needs to be awaited? #4764

Answered by mcollina
gajus asked this question in Q&A
May 19, 2023 · 1 comments · 8 replies
Discussion options

You must be logged in to vote
app.get<{ Params: { domain: string } }>(
    '/domains/validate/:domain',
    async (request, reply) => {
      const domain = request.params.domain;

      const status = await services.customDomain.getCustomDomainStatus({
        domain,
      });

      if (status === 'ACTIVE') {
        return reply.code(204).send();
      } else {
        return reply.code(404).send();
      }
    },
  );

or

app.get<{ Params: { domain: string } }>(
    '/domains/validate/:domain',
    async (request, reply) => {
      const domain = request.params.domain;

      const status = await services.customDomain.getCustomDomainStatus({
        domain,
      });

      if (status === 'ACTIVE') {
        repl…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@gajus
Comment options

@mcollina
Comment options

Answer selected by gajus
@gajus
Comment options

@gajus
Comment options

@mcollina
Comment options

@mcollina
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants