working create grants, getall, and delete with clean methods

This commit is contained in:
Arjun Patel
2019-01-18 18:02:04 -08:00
parent f046a9f605
commit b0597a99e2
7 changed files with 74 additions and 78 deletions
-3
View File
@@ -4,21 +4,18 @@ module.exports = models => {
Donors.hasMany(Grants, { foreignKey: 'donor_id' });
Grants.belongsToMany(Causes, {
as: 'GrantsCauses',
through: 'grants_causes',
foreignKey: 'grant_id',
otherKey: 'cause_id'
});
Grants.belongsToMany(Regions, {
as: 'GrantsRegions',
through: 'grants_regions',
foreignKey: 'grant_id',
otherKey: 'region_id'
});
Grants.belongsToMany(Organizations, {
as: 'GrantsOrganizations',
through: 'grants_organizations',
foreignKey: 'grant_id',
otherKey: 'organization_id'