SpiderNitt/Document-Request-Portal

A wrapper for database field retreival out of the sequelize object

开放

#11 创建于 2020年9月26日

 (0 条评论) (0 个反应) (1 位负责人)JavaScript (3 个派生)auto 404
backendenhancementgood first issue

仓库指标

星标
 (2 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Is your feature request related to a problem? Please describe. After getting the row object from sequelize, it is painful to type row.getDataValue('') everytime. Have a wrapper instead of that.

Describe the solution you'd like

const row = await database.Certificate.findOne({.....})
{applier_roll, name, type, status} = your_custom_wrapper(row)

Have any number of row.getDataValue inside your custom wrapper. It should return an object with the fields expected.

贡献者指南