1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-20 20:19:35 +02:00

Add app categories (#0)

add app categories
This commit is contained in:
François Darveau 2021-06-26 15:06:47 -04:00 committed by François Darveau
parent 6f44200a3c
commit 31cf2bc5ad
24 changed files with 1772 additions and 939 deletions

View file

@ -1,7 +1,17 @@
const Category = require('./Category');
const App = require('./App');
const Bookmark = require('./Bookmark');
const associateModels = () => {
// Category <> App
Category.hasMany(App, {
as: 'apps',
foreignKey: 'categoryId'
});
App.belongsTo(Category, { foreignKey: 'categoryId' });
// Category <> Bookmark
Category.hasMany(Bookmark, {
foreignKey: 'categoryId',
as: 'bookmarks'