sort feedback
This commit is contained in:
parent
72c6f4bf79
commit
7ba898d988
|
@ -66,11 +66,15 @@ export async function getAllLingdocsUsers(): Promise<T.LingdocsUser[]> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getAllFeedback(): Promise<any[]> {
|
export async function getAllFeedback(): Promise<any[]> {
|
||||||
const res = await feedbackDb.find({
|
const { docs } = await feedbackDb.find({
|
||||||
selector: { feedback: { $exists: true } },
|
selector: {
|
||||||
|
feedback: { $exists: true },
|
||||||
|
limit: 5000,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
console.log({ res });
|
// @ts-ignore
|
||||||
return res.docs as any[];
|
docs.sort((a, b) => a.feedback.ts - b.feedback.ts);
|
||||||
|
return docs as any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function insertLingdocsUser(
|
export async function insertLingdocsUser(
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<%= new Date(docs[i].feedback.ts).toDateString() %>
|
<%= new Date(docs[i].feedback.ts).toDateString() %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= docs[i].feedback.user %>
|
<%= docs[i].user %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= docs[i].feedback.chapter %>
|
<%= docs[i].feedback.chapter %>
|
||||||
|
|
Loading…
Reference in New Issue