mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-05-07 20:32:26 +00:00
disable zodios request/response validation in runtime and use server errors instead
This commit is contained in:
+13
-13
@@ -167,12 +167,12 @@ const TimeEntryStoreRequest = z
|
||||
end: z.union([z.string(), z.null()]).optional(),
|
||||
billable: z.boolean(),
|
||||
description: z.union([z.string(), z.null()]).optional(),
|
||||
tags: z.union([z.array(z.string()), z.null()]).optional(),
|
||||
tags: z.union([z.array(z.string().uuid()), z.null()]).optional(),
|
||||
})
|
||||
.passthrough();
|
||||
const TimeEntryUpdateMultipleRequest = z
|
||||
.object({
|
||||
ids: z.array(z.string()),
|
||||
ids: z.array(z.string().uuid()),
|
||||
changes: z
|
||||
.object({
|
||||
member_id: z.string().uuid(),
|
||||
@@ -180,7 +180,7 @@ const TimeEntryUpdateMultipleRequest = z
|
||||
task_id: z.union([z.string(), z.null()]),
|
||||
billable: z.boolean(),
|
||||
description: z.union([z.string(), z.null()]),
|
||||
tags: z.union([z.array(z.string()), z.null()]),
|
||||
tags: z.union([z.array(z.string().uuid()), z.null()]),
|
||||
})
|
||||
.partial()
|
||||
.passthrough(),
|
||||
@@ -195,7 +195,7 @@ const TimeEntryUpdateRequest = z
|
||||
end: z.union([z.string(), z.null()]),
|
||||
billable: z.boolean(),
|
||||
description: z.union([z.string(), z.null()]),
|
||||
tags: z.union([z.array(z.string()), z.null()]),
|
||||
tags: z.union([z.array(z.string().uuid()), z.null()]),
|
||||
})
|
||||
.partial()
|
||||
.passthrough();
|
||||
@@ -2041,22 +2041,22 @@ Users with the permission `time-entries:view:own` can only use this en
|
||||
{
|
||||
name: 'member_ids',
|
||||
type: 'Query',
|
||||
schema: z.array(z.string()).min(1).optional(),
|
||||
schema: z.array(z.string().uuid()).min(1).optional(),
|
||||
},
|
||||
{
|
||||
name: 'project_ids',
|
||||
type: 'Query',
|
||||
schema: z.array(z.string()).min(1).optional(),
|
||||
schema: z.array(z.string().uuid()).min(1).optional(),
|
||||
},
|
||||
{
|
||||
name: 'tag_ids',
|
||||
type: 'Query',
|
||||
schema: z.array(z.string()).min(1).optional(),
|
||||
schema: z.array(z.string().uuid()).min(1).optional(),
|
||||
},
|
||||
{
|
||||
name: 'task_ids',
|
||||
type: 'Query',
|
||||
schema: z.array(z.string()).min(1).optional(),
|
||||
schema: z.array(z.string().uuid()).min(1).optional(),
|
||||
},
|
||||
{
|
||||
name: 'client_ids',
|
||||
@@ -2387,27 +2387,27 @@ If the group parameters are all set to `null` or are all missing, the
|
||||
{
|
||||
name: 'member_ids',
|
||||
type: 'Query',
|
||||
schema: z.array(z.string()).min(1).optional(),
|
||||
schema: z.array(z.string().uuid()).min(1).optional(),
|
||||
},
|
||||
{
|
||||
name: 'project_ids',
|
||||
type: 'Query',
|
||||
schema: z.array(z.string()).min(1).optional(),
|
||||
schema: z.array(z.string().uuid()).min(1).optional(),
|
||||
},
|
||||
{
|
||||
name: 'client_ids',
|
||||
type: 'Query',
|
||||
schema: z.array(z.string()).min(1).optional(),
|
||||
schema: z.array(z.string().uuid()).min(1).optional(),
|
||||
},
|
||||
{
|
||||
name: 'tag_ids',
|
||||
type: 'Query',
|
||||
schema: z.array(z.string()).min(1).optional(),
|
||||
schema: z.array(z.string().uuid()).min(1).optional(),
|
||||
},
|
||||
{
|
||||
name: 'task_ids',
|
||||
type: 'Query',
|
||||
schema: z.array(z.string()).min(1).optional(),
|
||||
schema: z.array(z.string().uuid()).min(1).optional(),
|
||||
},
|
||||
],
|
||||
response: z
|
||||
|
||||
Generated
+351
-409
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -40,7 +40,7 @@
|
||||
"@tailwindcss/container-queries": "^0.1.1",
|
||||
"@vue/eslint-config-prettier": "^9.0.0",
|
||||
"@vue/eslint-config-typescript": "^13.0.0",
|
||||
"@vueuse/core": "^10.9.0",
|
||||
"@vueuse/core": "^10.11.0",
|
||||
"dayjs": "^1.11.11",
|
||||
"echarts": "^5.5.0",
|
||||
"parse-duration": "^1.1.0",
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { Invitation } from '@/utils/api';
|
||||
import TableRow from '@/Components/TableRow.vue';
|
||||
import { capitalizeFirstLetter } from '../../../utils/format';
|
||||
import InvitationMoreOptionsDropdown from '@/Components/Common/Invitation/InvitationMoreOptionsDropdown.vue';
|
||||
import { api } from '../../../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { getCurrentOrganizationId } from '@/utils/useUser';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
import { useInvitationsStore } from '@/utils/useInvitations';
|
||||
|
||||
@@ -14,7 +14,7 @@ import { filterRoles } from '@/utils/roles';
|
||||
import { hasActiveSubscription, isBillingActivated } from '@/utils/billing';
|
||||
import { CreditCardIcon, UserGroupIcon } from '@heroicons/vue/20/solid';
|
||||
import { canUpdateOrganization } from '@/utils/permissions';
|
||||
import { api } from '../../../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import type { MemberRole } from '@/utils/api';
|
||||
import { z } from 'zod';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
|
||||
@@ -5,7 +5,7 @@ import MemberMoreOptionsDropdown from '@/Components/Common/Member/MemberMoreOpti
|
||||
import TableRow from '@/Components/TableRow.vue';
|
||||
import { capitalizeFirstLetter } from '../../../utils/format';
|
||||
import SecondaryButton from '@/Components/SecondaryButton.vue';
|
||||
import { api } from '../../../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { getCurrentOrganizationId } from '@/utils/useUser';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
import { canInvitePlaceholderMembers } from '@/utils/permissions';
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
import { PlusCircleIcon } from '@heroicons/vue/20/solid';
|
||||
import ProjectDropdownItem from '@/Components/Common/Project/ProjectDropdownItem.vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { api } from '../../../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { usePage } from '@inertiajs/vue3';
|
||||
import { getRandomColor } from '@/utils/color';
|
||||
import type { Project } from '@/utils/api';
|
||||
|
||||
@@ -53,9 +53,9 @@ const deleteTeam = () => {
|
||||
<template #title> Delete Organization </template>
|
||||
|
||||
<template #content>
|
||||
Are you sure you want to delete this organization? Once a organization is
|
||||
deleted, all of its resources and data will be permanently
|
||||
deleted.
|
||||
Are you sure you want to delete this organization? Once a
|
||||
organization is deleted, all of its resources and data will
|
||||
be permanently deleted.
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
|
||||
@@ -3,7 +3,7 @@ import FormSection from '@/Components/FormSection.vue';
|
||||
import PrimaryButton from '@/Components/PrimaryButton.vue';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
import { api } from '../../../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import InputLabel from '@/Components/InputLabel.vue';
|
||||
import { DocumentIcon } from '@heroicons/vue/24/solid';
|
||||
import { getCurrentOrganizationId } from '@/utils/useUser';
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
ZodiosBodyByAlias,
|
||||
ZodiosQueryParamsByAlias,
|
||||
} from '@zodios/core';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { createApiClient } from '../../../openapi.json.client';
|
||||
import { router } from '@inertiajs/vue3';
|
||||
|
||||
export type SolidTimeApi = ApiOf<typeof api>;
|
||||
@@ -147,3 +147,5 @@ export async function fetchToken() {
|
||||
export function isTokenValid() {
|
||||
return window.document.cookie.includes('solidtime_session');
|
||||
}
|
||||
|
||||
export const api = createApiClient('/api', { validate: 'none' });
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { computed, ref } from 'vue';
|
||||
import type {
|
||||
CreateClientBody,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import type { TimeEntry } from '@/utils/api';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { computed, ref } from 'vue';
|
||||
import type {
|
||||
InvitationsIndexResponse,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { computed, ref } from 'vue';
|
||||
import type {
|
||||
Member,
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
} from '@/utils/api';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
import { getCurrentOrganizationId } from '@/utils/useUser';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
|
||||
export function switchOrganization(organizationId: string) {
|
||||
router.put(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { computed, ref } from 'vue';
|
||||
import type {
|
||||
CreateProjectMemberBody,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { computed, ref } from 'vue';
|
||||
import type {
|
||||
CreateProjectBody,
|
||||
@@ -34,6 +34,7 @@ export const useProjectsStore = defineStore('projects', () => {
|
||||
|
||||
async function createProject(projectBody: CreateProjectBody) {
|
||||
const organization = getCurrentOrganizationId();
|
||||
|
||||
if (organization) {
|
||||
const response = await handleApiRequestNotifications(
|
||||
() =>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineStore, storeToRefs } from 'pinia';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { type Component, computed, ref } from 'vue';
|
||||
import type {
|
||||
AggregatedTimeEntries,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
|
||||
import { ref } from 'vue';
|
||||
import type { Tag } from '@/utils/api';
|
||||
import { getCurrentOrganizationId } from '@/utils/useUser';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
|
||||
export const useTagsStore = defineStore('tags', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { getCurrentOrganizationId } from '@/utils/useUser';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
import { api } from '@/utils/api';
|
||||
import { reactive, ref } from 'vue';
|
||||
import type { CreateTaskBody, Task, UpdateTaskBody } from '@/utils/api';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
|
||||
@@ -3,9 +3,9 @@ import {
|
||||
getCurrentMembershipId,
|
||||
getCurrentOrganizationId,
|
||||
} from '@/utils/useUser';
|
||||
import { api } from '../../../openapi.json.client';
|
||||
|
||||
import { reactive, ref } from 'vue';
|
||||
import type { CreateTimeEntryBody, TimeEntry } from '@/utils/api';
|
||||
import { api, type CreateTimeEntryBody, type TimeEntry } from '@/utils/api';
|
||||
import dayjs from 'dayjs';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user