Greenstand/treetracker-query-api

Extend the BaseRepository to support: add

オープン

#23 opened on 2021/12/30

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (65 件のフォーク)auto 404
Node.jsgood first issuepostgresql

Repository metrics

Stars
 (17 個のスター)
PR merge metrics
 (PR metrics pending)

説明

The function is for creating a new entity in the database.

The function signature should like:

add<T>(object: T>: T

So the subclass can do:

TokenRepository.add(token)

Possible edge cases:

  • Unexpected property: id. (422 HTTP code with error message)
  • Maybe there are some cases that database will throw error like, foreign key violation, we should translate this type of exception to : (500, database exception)

Some hints:

  • Please read our readme for more information/guide/tutorial.
  • Here is an engineering book in Greenstand.
  • To know more about our organization, visit our website.
  • If you want to join the slack community (some resources need the community member's permission), please leave your email address.

コントリビューターガイド