From fffe911f89985be967a154dd3833d312683e6bd6 Mon Sep 17 00:00:00 2001 From: manelcecs Date: Thu, 14 Sep 2023 09:41:55 +0200 Subject: [PATCH] Remove PLAN_TAG_REVISION_STATE from planTag --- src/db/models/plan.ts | 2 +- src/db/models/planTag.ts | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/db/models/plan.ts b/src/db/models/plan.ts index 3680e972..eae0c695 100644 --- a/src/db/models/plan.ts +++ b/src/db/models/plan.ts @@ -8,7 +8,7 @@ export type PlanId = Brand; export const PLAN_ID = brandedType(t.number); -const PLAN_REVISION_STATE = t.keyof({ +export const PLAN_REVISION_STATE = t.keyof({ projectsOnly: null, none: null, planDataAndProjects: null, diff --git a/src/db/models/planTag.ts b/src/db/models/planTag.ts index cb743d9e..31955819 100644 --- a/src/db/models/planTag.ts +++ b/src/db/models/planTag.ts @@ -4,6 +4,7 @@ import { brandedType } from '../../util/io-ts'; import type { Brand } from '../../util/types'; import { defineIDModel } from '../util/id-model'; import { PLAN_ID } from './plan'; +import { PLAN_REVISION_STATE } from './plan'; export type PlanTagId = Brand< number, @@ -19,13 +20,6 @@ const PLAN_TAG_PUBLISH_TYPE = t.keyof({ custom: null, }); -export const PLAN_TAG_REVISION_STATE = t.keyof({ - none: null, - planDataAndProjects: null, - planDataOnly: null, - projectsOnly: null, -}); - export default defineIDModel({ tableName: 'planTag', fields: { @@ -42,7 +36,7 @@ export default defineIDModel({ }, optional: { comment: { kind: 'checked', type: t.string }, - revisionState: { kind: 'checked', type: PLAN_TAG_REVISION_STATE }, + revisionState: { kind: 'checked', type: PLAN_REVISION_STATE }, type: { kind: 'checked', type: PLAN_TAG_PUBLISH_TYPE }, }, },