core&ui: user_detail: show solutions (#414)

This commit is contained in:
undefined committed 2022-08-29 15:41:50 +08:00
1 parent e3dd65c690
commit 6ed4d74210
8 files changed
+62 -30

No files matched your search

+7
View File
@@ -46,6 +46,13 @@ class SolutionModel {
).sort({ vote: -1 });
}
static getByUser(domainId: string, uid: number) {
return document.getMulti(
domainId, document.TYPE_PROBLEM_SOLUTION,
{ parentType: document.TYPE_PROBLEM, owner: uid },
).sort({ _id: -1 });
}
static reply(domainId: string, psid: ObjectID, owner: number, content: string) {
return document.push(domainId, document.TYPE_PROBLEM_SOLUTION, psid, 'reply', content, owner);
}