mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-14 11:12:16 +01:00
add manual time entry feature
This commit is contained in:
@@ -22,6 +22,11 @@ export type TimeEntryResponse = ZodiosResponseByAlias<
|
||||
>;
|
||||
export type TimeEntry = TimeEntryResponse['data'][0];
|
||||
|
||||
export type CreateTimeEntryBody = ZodiosBodyByAlias<
|
||||
SolidTimeApi,
|
||||
'createTimeEntry'
|
||||
>;
|
||||
|
||||
export type ProjectResponse = ZodiosResponseByAlias<
|
||||
SolidTimeApi,
|
||||
'getProjects'
|
||||
|
||||
@@ -71,7 +71,7 @@ export const useNotificationsStore = defineStore('notifications', () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
throw new Error('Failed to handle API request');
|
||||
}
|
||||
|
||||
return { addNotification, notifications, handleApiRequestNotifications };
|
||||
|
||||
@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
|
||||
import { getCurrentOrganizationId, getCurrentUserId } from '@/utils/useUser';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { reactive, ref } from 'vue';
|
||||
import type { TimeEntry } from '@/utils/api';
|
||||
import type { CreateTimeEntryBody, TimeEntry } from '@/utils/api';
|
||||
import dayjs from 'dayjs';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
|
||||
@@ -83,7 +83,7 @@ export const useTimeEntriesStore = defineStore('timeEntries', () => {
|
||||
}
|
||||
}
|
||||
|
||||
async function createTimeEntry(timeEntry: TimeEntry) {
|
||||
async function createTimeEntry(timeEntry: CreateTimeEntryBody) {
|
||||
const organizationId = getCurrentOrganizationId();
|
||||
if (organizationId) {
|
||||
await handleApiRequestNotifications(
|
||||
|
||||
Reference in New Issue
Block a user