manifold/web/lib/firebase/views.ts
2022-04-04 22:28:38 -05:00

17 lines
401 B
TypeScript

import { doc, collection, setDoc } from 'firebase/firestore'
import _ from 'lodash'
import { db } from './init'
import { View } from '../../../common/view'
export async function logView(userId: string, contractId: string) {
const ref = doc(collection(db, 'private-users', userId, 'views'))
const view: View = {
contractId,
timestamp: Date.now(),
}
return await setDoc(ref, view)
}