refactor(sync): export designation-matching helpers for reuse
This commit is contained in:
parent
fb3fe67164
commit
d8aaea33e6
1 changed files with 2 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ import { isRelevantDueDate } from './task-due-date'
|
||||||
const DAY_MS = 24 * 60 * 60 * 1000
|
const DAY_MS = 24 * 60 * 60 * 1000
|
||||||
|
|
||||||
/** Designation IDs (primary + secondary) of a client, with nulls dropped. */
|
/** Designation IDs (primary + secondary) of a client, with nulls dropped. */
|
||||||
function designationIdsOf(entity: {
|
export function designationIdsOf(entity: {
|
||||||
designationId: string | null
|
designationId: string | null
|
||||||
designation2Id: string | null
|
designation2Id: string | null
|
||||||
}): string[] {
|
}): string[] {
|
||||||
|
|
@ -16,7 +16,7 @@ function designationIdsOf(entity: {
|
||||||
* Prisma `OR` clause matching templates that apply to a client: templates with
|
* Prisma `OR` clause matching templates that apply to a client: templates with
|
||||||
* no designation, plus templates scoped to one of the client's designations.
|
* no designation, plus templates scoped to one of the client's designations.
|
||||||
*/
|
*/
|
||||||
function designationFilter(ids: string[]) {
|
export function designationFilter(ids: string[]) {
|
||||||
return [
|
return [
|
||||||
{ designationId: null },
|
{ designationId: null },
|
||||||
...(ids.length > 0 ? [{ designationId: { in: ids } }] : []),
|
...(ids.length > 0 ? [{ designationId: { in: ids } }] : []),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue