api Page updated: refactor to make it looks like article

This commit is contained in:
tmshv committed 2020-03-02 04:40:01 +03:00
1 parent 68b7f4225d
commit 348c3baba8
11 files changed
+160 -63

No files matched your search

+2 -1
View File
@@ -2,11 +2,12 @@ import Data from './Data'
import ImageArtifactType from './ImageArtifactType'
import { findOne } from '../lib/store'
import { mapOf } from '../server/lib'
import { ObjectId } from 'mongodb'
const store = () => Data.getStore('Image')
export default class Image {
static async findById(id) {
static async findById(id: ObjectId) {
const data = await findOne(store(), { _id: id })
if (!data) return null