123456789101112131415161718192021222324252627282930313233343536373839404142 |
- "use strict";
- var __assign = (this && this.__assign) || function () {
- __assign = Object.assign || function(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
- };
- return __assign.apply(this, arguments);
- };
- exports.__esModule = true;
- var db_1 = require("../db");
- var sequelize_1 = require("sequelize");
- var ProposalVote = db_1["default"].define('proposalvote', {
- vote: sequelize_1.DataTypes.STRING
- });
- ProposalVote.findAllWithIncludes = function () {
- return this.findAll({
- include: [
- { model: db_1["default"].models.member, attributes: ['handle'] },
- { model: db_1["default"].models.consul },
- { model: db_1["default"].models.proposal, attributes: ['title'] },
- ]
- });
- };
- ProposalVote.findByIdWithIncludes = function (id, args) {
- return this.findByPk(id, __assign(__assign({}, args), { include: [
- { model: db_1["default"].models.member, attributes: ['handle'] },
- { model: db_1["default"].models.consul },
- { model: db_1["default"].models.proposal, attributes: ['title'] },
- ] }));
- };
- ProposalVote.findWithIncludes = function (args) {
- return this.findAll(__assign(__assign({}, args), { include: [
- { model: db_1["default"].models.member, attributes: ['handle'] },
- { model: db_1["default"].models.consul },
- { model: db_1["default"].models.proposal, attributes: ['title'] },
- ] }));
- };
- exports["default"] = ProposalVote;
|