1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-13 10:48:19 +01:00
Pinafore-Web-Client-Frontend/routes/_database/relationships.js
2018-08-25 22:03:33 -07:00

12 lines
544 B
JavaScript

import { cloneForStorage, getGenericEntityWithId, setGenericEntityWithId } from './helpers'
import { RELATIONSHIPS_STORE } from './constants'
import { relationshipsCache } from './cache'
export async function getRelationship (instanceName, accountId) {
return getGenericEntityWithId(RELATIONSHIPS_STORE, relationshipsCache, instanceName, accountId)
}
export async function setRelationship (instanceName, relationship) {
return setGenericEntityWithId(RELATIONSHIPS_STORE, relationshipsCache, instanceName, cloneForStorage(relationship))
}