* Login entry point * feedback review * sort imports * Fix model relations * Handle when no current team or current channel has been selected * Fix MFA unit test * update prepareCommonSystemValues arguments
27 lines
938 B
TypeScript
27 lines
938 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {Relation} from '@nozbe/watermelondb';
|
|
import {immutableRelation, json} from '@nozbe/watermelondb/decorators';
|
|
import Model from '@nozbe/watermelondb/Model';
|
|
|
|
import {MM_TABLES} from '@constants/database';
|
|
import {safeParseJSON} from '@utils/helpers';
|
|
|
|
import type PostModel from '@typings/database/models/servers/post';
|
|
|
|
const {POST, POST_METADATA} = MM_TABLES.SERVER;
|
|
|
|
/**
|
|
* PostMetadata provides additional information on a POST
|
|
*/
|
|
export default class PostMetadataModel extends Model {
|
|
/** table (name) : PostMetadata */
|
|
static table = POST_METADATA;
|
|
|
|
/** data : Different types of data ranging from embeds to images. */
|
|
@json('data', safeParseJSON) data!: PostMetadata;
|
|
|
|
/** post: The record representing the POST parent. */
|
|
@immutableRelation(POST, 'id') post!: Relation<PostModel>;
|
|
}
|