Skip to content

Commit

Permalink
refactor: update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
calebpitan committed Nov 17, 2024
1 parent cabda35 commit 3f2994c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
5 changes: 3 additions & 2 deletions src/components/management/MgmtScheduleSummary.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { TaskSchedule } from '@stitches/common'
import { useLocale } from '@/composables/useLocale'
import type { TaskSchedule } from '@/interfaces/schedule'
import IconLoopOff from '../icons/IconLoopOff.vue'
import IconLoopOn from '../icons/IconLoopOn.vue'
Expand All @@ -22,7 +23,7 @@ const freqTypeMap = {
custom: 'custom',
get(key: Exclude<keyof typeof this, 'get'>) {
return this[key]
}
},
}
</script>

Expand Down
17 changes: 9 additions & 8 deletions src/stores/schedule.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { ref } from 'vue'

import type { BaseTaskSchedule, TaskSchedule } from '@stitches/common'

import { plainToInstance } from 'class-transformer'
import { defineStore } from 'pinia'

import type { BaseTaskSchedule, TaskSchedule } from '@/interfaces/schedule'
import { ScheduleSerializer } from '@/serializers/schedule'
import { createDeserializer, createReadGuard, ulid } from '@/utils'

Expand Down Expand Up @@ -32,7 +33,7 @@ export const useTaskScheduleStore = defineStore(
id: ulid(),
taskId: data.taskId,
frequency: data.frequency,
timestamp: data.timestamp
timestamp: data.timestamp,
}

schedules.value.push(schedule)
Expand Down Expand Up @@ -65,7 +66,7 @@ export const useTaskScheduleStore = defineStore(
findSchedule,
updateSchedule,
upsertSchedule,
deleteSchedule
deleteSchedule,
}
},
{
Expand All @@ -75,12 +76,12 @@ export const useTaskScheduleStore = defineStore(
deserialize: createDeserializer<Record<'schedules', TaskSchedule[]>>((data) => {
const serialized = plainToInstance(ScheduleSerializer, data.schedules, {
enableImplicitConversion: true,
strategy: 'excludeAll'
strategy: 'excludeAll',
})

return { schedules: serialized }
})
}
}
}
}),
},
},
},
)
2 changes: 1 addition & 1 deletion src/worker/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Observable } from 'rxjs'

import type { TaskSchedule } from '@/interfaces/schedule'
import type { TaskSchedule } from '@stitches/common'

import type { MasterMessageEventData, WorkerMessageEventData } from './types'

Expand Down
2 changes: 1 addition & 1 deletion src/worker/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TaskSchedule } from '@/interfaces/schedule'
import type { TaskSchedule } from '@stitches/common'

export type SchedulerWorkerActions = 'abort' | 'run' | 'subscribe'
export type SchedulerWorkerCommamds =
Expand Down

0 comments on commit 3f2994c

Please sign in to comment.