Skip to content

Conversation

@brunohcastro
Copy link
Collaborator

No description provided.

@brunohcastro brunohcastro force-pushed the tooling-and-code-cleanup branch from 20a0085 to 0372d16 Compare August 25, 2022 04:11
'accept, accept-encoding, origin, referer, sec-fetch-*, user-agent, content-type, authorization',
credentials: true,
origin: typeof http.cors === 'boolean' ? req.get('origin') : http.cors?.allowedOrigins,
methods: '*',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should add this (and the allowed headers) to the configs as well?

MONGO_INITDB_ROOT_PASSWORD: blog

mongo-express:
container_name: nab-mongo-express
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of nab (for this reason https://www.oxfordlearnersdictionaries.com/definition/american_english/nab), what do you think about pretending the container names with app, blog or something like that?

const type = Symbol();
const code = 'BadRequestError';
const name = 'BadRequestError';
const _message = 'Bad Request';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about calling it defaultMessage?

meta?: M;
}>;

type Props<M = any> = Omit<Exception<M>, 'name'> & { name?: string };
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about introducing this type to the _lib and using it here?

type PartializeProperties<Type, Properties extends keyof Type> = Omit<Type, Properties> &
  Partial<Pick<Type, Properties>>;

This way we don't need to change two parts of the same line in case we make another property optional.

return repl;
};

let destroySocket: (...args: any) => void = () => null;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we able to use the socket type itself here?

Suggested change
let destroySocket: (...args: any) => void = () => null;
let destroySocket: Socket['destroy'] = () => null;

throw BusinessError.create(
useBundle('article.error.alreadyPublished', { id: payload, publishedAt: article.publishedAt })
// eslint-disable-next-line max-len
`Can't republish the Article(id=${payload}) because it was already published on ${article.publishedAt.toISOString()}`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`Can't republish the Article(id=${payload}) because it was already published on ${article.publishedAt.toISOString()}`
`Can't republish the Article(id=${payload}) because it was already published at ${article.publishedAt.toISOString()}`

@brunohcastro brunohcastro force-pushed the tooling-and-code-cleanup branch from 4240de5 to 1809a50 Compare August 25, 2022 17:54
@brunohcastro brunohcastro merged commit 7e6ae0e into main Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants