2021-06-15 20:13:42 +00:00
|
|
|
import database from '..';
|
|
|
|
import { TABLE_NAME } from '../model/Thread';
|
|
|
|
|
|
|
|
const getCollection = db => db.get(TABLE_NAME);
|
|
|
|
|
2021-10-01 18:12:19 +00:00
|
|
|
export const getThreadById = async tmid => {
|
2021-06-15 20:13:42 +00:00
|
|
|
const db = database.active;
|
|
|
|
const threadCollection = getCollection(db);
|
|
|
|
try {
|
|
|
|
const result = await threadCollection.find(tmid);
|
|
|
|
return result;
|
|
|
|
} catch (error) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
};
|