forked from CherryHQ/cherry-studio-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTopicDatabase.ts
More file actions
55 lines (45 loc) · 1.39 KB
/
TopicDatabase.ts
File metadata and controls
55 lines (45 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import {
deleteTopicById as _deleteTopicById,
deleteTopicsByAssistantId as _deleteTopicsByAssistantId,
getNewestTopic as _getNewestTopic,
getTopicById as _getTopicById,
getTopics as _getTopics,
getTopicsByAssistantId as _getTopicsByAssistantId,
isTopicOwnedByAssistant as _isTopicOwnedByAssistant,
upsertTopics as _upsertTopics
} from '@db/queries/topics.queries'
import type { Topic } from '@/types/assistant'
export async function upsertTopics(topics: Topic | Topic[]) {
return _upsertTopics(topics)
}
export async function deleteTopicById(topicId: string) {
return _deleteTopicById(topicId)
}
export async function deleteTopicsByAssistantId(assistantId: string) {
return _deleteTopicsByAssistantId(assistantId)
}
export async function getNewestTopic() {
return _getNewestTopic()
}
export async function getTopicById(topicId: string) {
return _getTopicById(topicId)
}
export async function getTopics() {
return _getTopics()
}
export async function getTopicsByAssistantId(assistantId: string) {
return _getTopicsByAssistantId(assistantId)
}
export async function isTopicOwnedByAssistant(assistantId: string, topicId: string) {
return _isTopicOwnedByAssistant(assistantId, topicId)
}
export const topicDatabase = {
upsertTopics,
deleteTopicById,
deleteTopicsByAssistantId,
getNewestTopic,
getTopicById,
getTopics,
getTopicsByAssistantId,
isTopicOwnedByAssistant
}