Only show own accounts on home page

This commit is contained in:
Cadence Ember 2025-04-09 13:21:41 +12:00
parent 2c05140382
commit 924c7395cf
7 changed files with 106 additions and 79 deletions

View file

@ -113,12 +113,18 @@ class From {
}
/**
* @param {Partial<U.Numberish<U.Models[Table]>>} conditions
* @param {Partial<U.ValueOrArray<U.Numberish<U.Models[Table]>>>} conditions
*/
where(conditions) {
const wheres = Object.entries(conditions).map(([col, value]) => {
this.parameters.push(value)
return `"${col}" = ?`
if (Array.isArray(value)) {
this.parameters.push(...value)
return `"${col}" IN (` + Array(value.length).fill("?").join(", ") + ")"
} else {
this.parameters.push(value)
return `"${col}" = ?`
}
})
this.sql += " WHERE " + wheres.join(" AND ")
return this