feat: get language in server too

This commit is contained in:
Julien Calixte
2026-03-01 18:49:43 +01:00
parent 6374566316
commit 8ff1e4acaa

View File

@@ -22,10 +22,10 @@ type NoteRow = {
export const getNotes = (cursor?: string, limit = 20) => { export const getNotes = (cursor?: string, limit = 20) => {
const notes = cursor const notes = cursor
? db.prepare( ? db.prepare(
"SELECT did, rkey, title, publishedAt, createdAt FROM note WHERE discoverable = 1 AND rkey < ? ORDER BY rkey DESC LIMIT ?", "SELECT did, rkey, title, publishedAt, createdAt, language FROM note WHERE discoverable = 1 AND rkey < ? ORDER BY rkey DESC LIMIT ?",
).all<NoteRow>(cursor, limit) ).all<NoteRow>(cursor, limit)
: db.prepare( : db.prepare(
"SELECT did, rkey, title, publishedAt, createdAt FROM note WHERE discoverable = 1 ORDER BY rkey DESC LIMIT ?", "SELECT did, rkey, title, publishedAt, createdAt, language FROM note WHERE discoverable = 1 ORDER BY rkey DESC LIMIT ?",
).all<NoteRow>(limit); ).all<NoteRow>(limit);
return { return {
@@ -37,10 +37,10 @@ export const getNotes = (cursor?: string, limit = 20) => {
export const getNotesByDid = (did: string, cursor?: string, limit = 20) => { export const getNotesByDid = (did: string, cursor?: string, limit = 20) => {
const notes = cursor const notes = cursor
? db.prepare( ? db.prepare(
"SELECT did, rkey, title, publishedAt, createdAt FROM note WHERE discoverable = 1 AND did = ? AND rkey < ? ORDER BY rkey DESC LIMIT ?", "SELECT did, rkey, title, publishedAt, createdAt, language FROM note WHERE discoverable = 1 AND did = ? AND rkey < ? ORDER BY rkey DESC LIMIT ?",
).all<NoteRow>(did, cursor, limit) ).all<NoteRow>(did, cursor, limit)
: db.prepare( : db.prepare(
"SELECT did, rkey, title, publishedAt, createdAt FROM note WHERE discoverable = 1 AND did = ? ORDER BY rkey DESC LIMIT ?", "SELECT did, rkey, title, publishedAt, createdAt, language FROM note WHERE discoverable = 1 AND did = ? ORDER BY rkey DESC LIMIT ?",
).all<NoteRow>(did, limit); ).all<NoteRow>(did, limit);
return { return {