import { SDK } from '@dilvant/bizcard-sdk'; import { XM } from '@dilvant/xm-sdk'; import { InAppLookup } from '../classes/InAppLookup'; import { SectionsSubscriber } from '../classes/SectionSubscriber'; export class CrudWallpaper { static async change(wallpaper: any, load: boolean = true) { if (!wallpaper) return; const { section } = wallpaper; delete wallpaper.section; // TODO: XM Wallpaper save // let dbWallpaper = await XM.Wallpaper.save(wallpaper); let dbWallpaper = await SDK.Wallpaper.save(wallpaper); await InAppLookup.findAndReplace(wallpaper._id, wallpaper, [`type`]); if (load && section) SectionsSubscriber.refresh(section); } }