mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-13 09:35:30 -04:00
18 lines
543 B
TypeScript
18 lines
543 B
TypeScript
import { type JSONContent } from '@tiptap/core'
|
|
import { type Row, tsToMillis } from './utils'
|
|
import { type Comment } from 'common/comment'
|
|
|
|
export const convertComment = (row: Row<'lover_comments'>): Comment => ({
|
|
id: row.id + '',
|
|
userId: row.user_id,
|
|
commentType: 'lover',
|
|
onUserId: row.on_user_id,
|
|
createdTime: tsToMillis(row.created_time),
|
|
userName: row.user_name,
|
|
userUsername: row.user_username,
|
|
userAvatarUrl: row.user_avatar_url,
|
|
hidden: row.hidden,
|
|
visibility: 'public',
|
|
content: row.content as JSONContent,
|
|
})
|