fastify-resty icon indicating copy to clipboard operation
fastify-resty copied to clipboard

How to accept array data for entitycontroller?

Open duclet opened this issue 4 years ago • 0 comments

import {Column, Entity, PrimaryColumn} from "typeorm";

export enum Permission {
     MODIFY_PROFILE = 'modify-profile',
     VIEW_PROFILE = 'view-profile',
}

@Entity()
export default class User {
     @PrimaryColumn()
     email!: string;

     @Column({
          type: "set",
          enum: Permission,
          nullable: true,
     })
     permissions!: Array<Permission>;
}

When using the controller, how do I set the permissions with multiple values? It seems like the code is only accepting it as a string so I can't provide multiple values.

duclet avatar Jan 12 '22 14:01 duclet