12345678910111213141516171819202122232425262728293031323334353637 |
- "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 ProposalPost = db_1["default"].define('proposalpost', {
- id: {
- type: sequelize_1.DataTypes.INTEGER,
- primaryKey: true
- },
- created: sequelize_1.DataTypes.INTEGER,
- updated: sequelize_1.DataTypes.INTEGER,
- edition: sequelize_1.DataTypes.INTEGER,
- text: sequelize_1.DataTypes.TEXT
- });
- ProposalPost.findAllWithIncludes = function () {
- return this.findAll({
- include: [{ association: 'author', attributes: ['handle'] }]
- });
- };
- ProposalPost.findByIdWithIncludes = function (id, args) {
- return this.findByPk(id, __assign(__assign({}, args), { include: [{ association: 'author', attributes: ['handle'] }] }));
- };
- ProposalPost.findWithIncludes = function (args) {
- return this.findAll(__assign(__assign({}, args), { include: [{ association: 'author', attributes: ['handle'] }] }));
- };
- exports["default"] = ProposalPost;
|