Skip to content

Mapping to nested properties #343

Answered by nartc
micalevisk asked this question in Q&A
Discussion options

You must be logged in to vote

There are two approaches:

  1. Would it be easier to create two small class for CreateWorkBo#work and CreateWorkBo#user?
class CreateWorkBo {
  work: {
    institutionOwner: number;
    title: string;
    markdownDescription: string;
    type: WorkType;
    weight: number;
    languageVersion: string;
    start: string;
    end: string;
    languageId: number;
    classId: number;
    forkedFromId?: number;
  }
  user: {
    allowedUsersIds: number[];
  }
}

becomes

class CreateWorkBoWork {
    institutionOwner: number;
    title: string;
    markdownDescription: string;
    type: WorkType;
    weight: number;
    languageVersion: string;
    start: string;
    end: string;
    languageId: nu…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@micalevisk
Comment options

Answer selected by micalevisk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants