Codes

Here, you'll find key exports for managing codes. These exports allow you to create, update and delete codes as needed.


Type

type Code = {
    id: number,
    name: string,
    description: string,
    code: string,
    createdAt: string
}

Exports

Search for a code

exports['redutzu-mdt']:SearchCode(id: number) // CodeType | null

Create a new code

exports['redutzu-mdt']:CreateCode({
  name = 'Code name',
  description = 'Code description',
  code = '1-101'
}) -- number (id)

Update a code

-- It returns a boolean (if it was successfully updated)
exports['redutzu-mdt']:UpdateCode(id, { name = 'New code name' }) -- boolean

Delete a code

-- It returns a boolean (if it was successfully deleted)
exports['redutzu-mdt']:DeleteCode(id: number) // boolean

Last updated