forked from Ivasoft/mattermost-mobile
[Gekidou] Allow multiple posts in thread and posts in channel for a specific root or channel (#5594)
* Allow multiple posts in thread and posts in channel for a specific root or channel * Apply suggestions from code review Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com> Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
This commit is contained in:
@@ -52,7 +52,7 @@ export default class ChannelModel extends Model {
|
||||
[GROUPS_IN_CHANNEL]: {type: 'has_many', foreignKey: 'channel_id'},
|
||||
|
||||
/** A CHANNEL can be associated with multiple POSTS_IN_CHANNEL (relationship is 1:N) */
|
||||
[POSTS_IN_CHANNEL]: {type: 'has_many', foreignKey: 'id'},
|
||||
[POSTS_IN_CHANNEL]: {type: 'has_many', foreignKey: 'channel_id'},
|
||||
|
||||
/** A CHANNEL can contain multiple POST (relationship is 1:N) */
|
||||
[POST]: {type: 'has_many', foreignKey: 'channel_id'},
|
||||
|
||||
@@ -38,7 +38,7 @@ export default class PostModel extends Model {
|
||||
[FILE]: {type: 'has_many', foreignKey: 'post_id'},
|
||||
|
||||
/** A POST can have multiple POSTS_IN_THREAD. (relationship is 1:N)*/
|
||||
[POSTS_IN_THREAD]: {type: 'has_many', foreignKey: 'id'},
|
||||
[POSTS_IN_THREAD]: {type: 'has_many', foreignKey: 'root_id'},
|
||||
|
||||
/** A POST can have multiple REACTION. (relationship is 1:N)*/
|
||||
[REACTION]: {type: 'has_many', foreignKey: 'post_id'},
|
||||
|
||||
@@ -26,6 +26,9 @@ export default class PostsInChannelModel extends Model {
|
||||
[CHANNEL]: {type: 'belongs_to', key: 'id'},
|
||||
};
|
||||
|
||||
/** channel_id: Associated channel identifier */
|
||||
@field('channel_id') channelId!: string;
|
||||
|
||||
/** earliest : The earliest timestamp of the post in that channel */
|
||||
@field('earliest') earliest!: number;
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@ export default class PostsInThreadModel extends Model {
|
||||
[POST]: {type: 'belongs_to', key: 'id'},
|
||||
};
|
||||
|
||||
/** root_id: Associated root post identifier */
|
||||
@field('root_id') rootId!: string;
|
||||
|
||||
/** earliest : Lower bound of a timestamp range */
|
||||
@field('earliest') earliest!: number;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user