mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 02:32:15 +01:00
disable zodios request/response validation in runtime and use server errors instead
This commit is contained in:
@@ -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