fix: cleanups for asset

This commit is contained in:
Wyatt Johnson
2018-07-11 16:35:20 -06:00
parent 35ba69c8ed
commit 871206740f
4 changed files with 31 additions and 11 deletions
+21
View File
@@ -0,0 +1,21 @@
import { Db } from "mongodb";
import {
findOrCreateAsset,
FindOrCreateAssetInput,
} from "talk-server/models/asset";
import { Tenant } from "talk-server/models/tenant";
export type FindOrCreateAsset = FindOrCreateAssetInput;
export async function findOrCreate(
db: Db,
tenant: Tenant,
input: FindOrCreateAsset
) {
// TODO: check to see if the tenant has enabled lazy asset creation.
const asset = await findOrCreateAsset(db, tenant.id, input);
return asset;
}