#Why nestjs HttpStatus not included 423 Locked?

4 messages · Page 1 of 1 (latest)

sacred rover
#

In order to implement the batch lock API, I thought that 423 Locked was appropriate to convey to the client that the lock identifier is locked.

However, nestjs HttpStatus did not include 423 Locked.
What is the reason?

earnest oak
#

that enum doesn't have all the http status code out there
just the common ones

#

as you can see, this was requested few times

#

if you really want to use the same enum, you can hacky around it like this:

import { HttpStatus as CoreHttpStatus } from '@nestjs/common'

enum MissingHttpStatus {
  LOCKED = 423,
}

export type HttpStatus = CoreHttpStatus | MissingHttpStatus
export const HttpStatus = { ...CoreHttpStatus, ...MissingHttpStatus }

// ...
const myStatus = HttpStatus.UPGRADE_LOCKED