removed fallback for setting post content_type, made pollmeta a partial extension

This commit is contained in:
noumantahir 2024-11-08 19:07:27 +05:00
parent 0122f0e8bb
commit b5312b3475
2 changed files with 2 additions and 4 deletions

View File

@ -1,5 +1,4 @@
export enum ContentType {
GENERAL = 'general',
POLL = 'poll',
}
@ -26,11 +25,10 @@ export interface PollMetadata {
hide_votes: boolean;
}
export interface PostMetadata extends PollMetadata {
export interface PostMetadata extends Partial<PollMetadata> {
// GENERAL
tags: string[];
token: string;
content_type: ContentType;
description: string;
format: string;
version: number;

View File

@ -246,7 +246,7 @@ export const extractMetadata = async ({
// const userReg = /(^|\s)(@[a-z][-.a-z\d]+[a-z\d])/gim;
let out: PostMetadata = {
content_type: contentType || ContentType.GENERAL,
content_type: contentType,
};
const mUrls = extractUrls(body);