Skip to content

Commit 22e6a0a

Browse files
committed
feat: add functionality to move applications directly to interview stage without scheduling
1 parent ddda624 commit 22e6a0a

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

app/components/InterviewScheduleSidebar.vue

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const form = reactive({
3434
3535
const errors = ref<Record<string, string>>({})
3636
const isSubmitting = ref(false)
37+
const isMoving = ref(false)
3738
const sendInvitationAfter = ref(false)
3839
3940
// ─── Email templates ──────────────────────────────────────────────
@@ -256,6 +257,24 @@ async function handleSubmit() {
256257
isSubmitting.value = false
257258
}
258259
}
260+
261+
// ─── Move to interview stage (no scheduling) ──────────────────────
262+
async function handleMoveToInterview() {
263+
isMoving.value = true
264+
errors.value = {}
265+
try {
266+
await $fetch(`/api/applications/${props.applicationId}`, {
267+
method: 'PATCH',
268+
body: { status: 'interview' },
269+
})
270+
await refreshNuxtData('interviews')
271+
emit('scheduled')
272+
} catch (err: any) {
273+
errors.value.submit = err?.data?.statusMessage ?? 'Failed to move to interview stage'
274+
} finally {
275+
isMoving.value = false
276+
}
277+
}
259278
</script>
260279

261280
<template>
@@ -637,19 +656,30 @@ async function handleSubmit() {
637656
<button
638657
type="button"
639658
class="flex-1 rounded-xl border border-surface-200 dark:border-surface-700 px-4 py-2.5 text-sm font-medium text-surface-600 dark:text-surface-400 hover:text-surface-800 hover:bg-surface-50 dark:hover:text-surface-200 dark:hover:bg-surface-800 transition-colors cursor-pointer"
659+
:disabled="isSubmitting || isMoving"
640660
@click="emit('close')"
641661
>
642662
Cancel
643663
</button>
644664
<button
645665
type="button"
646-
:disabled="isSubmitting"
666+
:disabled="isSubmitting || isMoving"
647667
class="flex-[1.5] rounded-xl bg-brand-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors cursor-pointer shadow-sm shadow-brand-600/20 dark:shadow-brand-500/10"
648668
@click="handleSubmit"
649669
>
650670
{{ isSubmitting ? 'Scheduling…' : 'Schedule Interview' }}
651671
</button>
652672
</div>
673+
<div class="mt-2.5 text-center">
674+
<button
675+
type="button"
676+
:disabled="isSubmitting || isMoving"
677+
class="text-[12px] text-surface-400 hover:text-surface-600 dark:text-surface-500 dark:hover:text-surface-300 underline underline-offset-2 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"
678+
@click="handleMoveToInterview"
679+
>
680+
{{ isMoving ? 'Moving…' : 'Skip scheduling — just move to interview stage' }}
681+
</button>
682+
</div>
653683
</div>
654684
</div>
655685
</Transition>

app/pages/dashboard/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const isEmpty = computed(() =>
290290

291291
<!-- To Review -->
292292
<NuxtLink
293-
:to="localePath('/dashboard/applications')"
293+
:to="localePath({ path: '/dashboard/applications', query: { status: 'new' } })"
294294
class="group relative rounded-2xl border bg-white dark:bg-surface-900 p-5 hover:shadow-md transition-all duration-200 no-underline overflow-hidden"
295295
:class="counts.newApplications > 0
296296
? 'border-warning-200 dark:border-warning-900/50 hover:border-warning-300/80 dark:hover:border-warning-800/60 hover:shadow-warning-500/5'

0 commit comments

Comments
 (0)