mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
fix: cleanups for asset
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user