Skip to content

How to accept array data for entitycontroller? #15

@duclet

Description

@duclet
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions