1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-23 07:09:44 +02:00

Add covers for cards

This commit is contained in:
Maksim Eltyshev 2020-04-23 03:02:53 +05:00
parent 6a68ec9c1e
commit 49dc28b0d7
26 changed files with 315 additions and 98 deletions

View file

@ -8,7 +8,7 @@ export default class extends Model {
static fields = {
id: attr(),
url: attr(),
thumbnailUrl: attr(),
coverUrl: attr(),
name: attr(),
cardId: fk({
to: 'Card',

View file

@ -1,4 +1,4 @@
import { Model, attr, fk, many } from 'redux-orm';
import { Model, attr, fk, many, oneToOne } from 'redux-orm';
import ActionTypes from '../constants/ActionTypes';
import Config from '../constants/Config';
@ -32,6 +32,11 @@ export default class extends Model {
as: 'board',
relatedName: 'cards',
}),
coverAttachmentId: oneToOne({
to: 'Attachment',
as: 'coverAttachment',
relatedName: 'coveredCard',
}),
users: many('User', 'cards'),
labels: many('Label', 'cards'),
};