Skip to content
Discussion options

You must be logged in to vote
  1. You need to ensure User constructor has all BaseEntity's constructor props, so you User constructor should be:
  constructor(props: { pk: string; sk: string; email: string; username: string; name: string }) {

What I usually end up doing is removing the props that are used in pk and sk and use getPrimaryKey static method like this:

UserManager.get(User.getPrimaryKey('jake'));
  1. Your entities looks corrupted to me, for example User sets pk and sk which should be BaseEntity responsibility (there are more mistakes, see what i did here):
export class User extends BaseEntity {
  @attribute.partitionKey.string({ prefix: 'USER' })
  override pk!: string;

  @attribute.sortKey.string({ prefix: '…

Replies: 5 comments 18 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
12 replies
@iak4v
Comment options

@iak4v
Comment options

@blazejkustra
Comment options

Answer selected by blazejkustra
@blazejkustra
Comment options

@iak4v
Comment options

@iak4v
Comment options

@blazejkustra
Comment options

Comment options

You must be logged in to vote
5 replies
@blazejkustra
Comment options

@blazejkustra
Comment options

@iak4v
Comment options

@blazejkustra
Comment options

@iak4v
Comment options

Comment options

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

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