Greenstand/treetracker-query-api

Extend the BaseRepository to support: delete

開放

#24 建立於 2021年12月30日

 (3 則留言) (0 個反應) (1 位負責人)TypeScript (65 個分叉)auto 404
Node.jsgood first issue

倉庫指標

星標
 (17 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

The function is for deleting the entity in the database.

The function signature should like:

delete<T>(object: T>: T

Some the subclass can do:

TokenRepository.delete(token)

Possible edge cases:

  • Can not find the entity by id. (404 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)
  • Our rule for deletion is that we don't really delete the record, but set the active field to false

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.

貢獻者指南