DB Configuration Table

Configuration Fields

  • provider: Refers to the main type of configuration this will be. (Ex: "AUTH").

  • name: The name of the configuration. (Ex: "Email Verification Attempts").

  • value: This is the value of the configuration in string. (Ex: "5").

  • slug: The slug is automatically formed by using the provider and the name. (Ex: "auth-email-verification-attempts").

You can use this table to store a value you want to use inside the API and change dynamically by calling the configuration endpoints.

But before creating a configuration, you need to add the provider manually inside the Provider enum in src/features/configuration/enums/provider.enum.ts to support it.

Example:

src/features/configuration/enums/provider.enum.ts
export enum Provider {
  AUTH = 'AUTH',
}

The provider and the name are used to auto generate the slug, which can be used in the code to retrieve an specific configuration value, like this:

const verificationAttempts = await this.configurationService.findBySlug(
  'auth-email-verification-attempts',
);

Last updated