From 5136ea025c52c1f8946c82625a223a92bef39570 Mon Sep 17 00:00:00 2001 From: Sr-Iury Date: Sat, 23 Nov 2024 21:53:23 -0300 Subject: [PATCH 1/3] fix: Correction of post-update errors in the API :bug: Errors were corrected throughout the code, from sections to the connection with the API in courses, subjects, classes, environments, blocks and even in users! --- components/Section/Ambientes/Form/Form.vue | 9 ++-- .../Section/Ambientes/Grid/Item/Item.vue | 4 +- components/Section/Blocos/Form/Form.vue | 6 +-- components/Section/Blocos/Grid/Item/Item.vue | 4 +- components/Section/Cursos/Form/Form.vue | 32 +++++++----- components/Section/Cursos/Grid/Item/Item.vue | 6 +-- components/Section/Disciplinas/Form/Form.vue | 7 ++- .../Section/Disciplinas/Grid/Item/Item.vue | 4 +- .../VV/Autocomplete/API/Ambiente/Ambiente.vue | 4 +- .../VV/Autocomplete/API/Bloco/Bloco.vue | 4 +- .../VV/Autocomplete/API/Campus/Campus.vue | 4 +- .../VV/Autocomplete/API/Curso/Curso.vue | 4 +- .../API/Disciplina/Disciplina.vue | 4 +- .../API/Modalidade/Modalidade.vue | 50 ------------------ .../API/OfertaFormacao/OfertaFormacao.vue | 52 +++++++++++++++++++ .../api/ambientes/useApiAmbienteFindOne.ts | 2 +- composables/api/blocos/useApiBlocosFindOne.ts | 2 +- composables/api/campus/useApiCampusFindOne.ts | 2 +- composables/api/cursos/useApiCursosFindOne.ts | 2 +- .../api/diarios/useApiDiariosFindOne.ts | 2 +- .../disciplinas/useApiDisciplinasFindOne.ts | 2 +- composables/api/index.ts | 2 +- composables/api/modalities/index.ts | 2 - .../api/modalities/useApiModalitiesFindAll.ts | 28 ---------- composables/api/ofertasformacoes/index.ts | 2 + .../useApiOfertaFormacaoFindAll.ts | 28 ++++++++++ .../useApiOfertaFormacaoFindOne.ts} | 12 ++--- composables/api/turmas/useApiTurmasFindOne.ts | 2 +- .../usuarios/useApiUsuarioVinculosAtivos.ts | 2 +- .../api/usuarios/useApiUsuariosFindOne.ts | 2 +- integrations/api/modules/index.ts | 6 +-- .../api/modules/useDisciplinaGetRetriever.ts | 2 +- integrations/api/modules/useModalidadeGet.ts | 14 ----- .../api/modules/useModalidadeGetRetriever.ts | 7 --- .../api/modules/useModalidadesRetriever.ts | 11 ---- .../api/modules/useOfertaFormacaoGet.ts | 14 +++++ .../modules/useOfertaFormacaoGetRetriever.ts | 7 +++ .../modules/useOfertasFormacoesRetriever.ts | 11 ++++ package-lock.json | 2 +- 39 files changed, 181 insertions(+), 179 deletions(-) delete mode 100644 components/VV/Autocomplete/API/Modalidade/Modalidade.vue create mode 100644 components/VV/Autocomplete/API/OfertaFormacao/OfertaFormacao.vue delete mode 100644 composables/api/modalities/index.ts delete mode 100644 composables/api/modalities/useApiModalitiesFindAll.ts create mode 100644 composables/api/ofertasformacoes/index.ts create mode 100644 composables/api/ofertasformacoes/useApiOfertaFormacaoFindAll.ts rename composables/api/{modalities/useApiModalitiesFindOne.ts => ofertasformacoes/useApiOfertaFormacaoFindOne.ts} (56%) delete mode 100644 integrations/api/modules/useModalidadeGet.ts delete mode 100644 integrations/api/modules/useModalidadeGetRetriever.ts delete mode 100644 integrations/api/modules/useModalidadesRetriever.ts create mode 100644 integrations/api/modules/useOfertaFormacaoGet.ts create mode 100644 integrations/api/modules/useOfertaFormacaoGetRetriever.ts create mode 100644 integrations/api/modules/useOfertasFormacoesRetriever.ts diff --git a/components/Section/Ambientes/Form/Form.vue b/components/Section/Ambientes/Form/Form.vue index b2ae6b5..3b7eece 100644 --- a/components/Section/Ambientes/Form/Form.vue +++ b/components/Section/Ambientes/Form/Form.vue @@ -80,7 +80,7 @@ const handleDelete = async () => { ); if (resposta) { - await apiClient.ambientes.ambienteDeleteById({ id: id }); + await apiClient.ambientes.ambienteDeleteOneById({ id: id }); await queryClient.invalidateQueries({ queryKey: ['ambientes'] }); $emit('close'); } @@ -120,7 +120,7 @@ const onSubmit = handleSubmit(async (values: FormOutput) => { }); id = ambienteCriado.id; } else { - await apiClient.ambientes.ambienteUpdateById({ + await apiClient.ambientes.ambienteUpdateOneById({ id: editId, requestBody: { @@ -132,11 +132,8 @@ const onSubmit = handleSubmit(async (values: FormOutput) => { } if (imagem) { - await apiClient.ambientes.ambienteSetCoverImage({ + await apiClient.ambientes.ambienteGetImagemCapa({ id: id, - formData: { - file: imagem, - }, }); } diff --git a/components/Section/Ambientes/Grid/Item/Item.vue b/components/Section/Ambientes/Grid/Item/Item.vue index 97572ac..8641090 100644 --- a/components/Section/Ambientes/Grid/Item/Item.vue +++ b/components/Section/Ambientes/Grid/Item/Item.vue @@ -1,5 +1,5 @@ - - diff --git a/components/VV/Autocomplete/API/OfertaFormacao/OfertaFormacao.vue b/components/VV/Autocomplete/API/OfertaFormacao/OfertaFormacao.vue new file mode 100644 index 0000000..243d5a2 --- /dev/null +++ b/components/VV/Autocomplete/API/OfertaFormacao/OfertaFormacao.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/composables/api/ambientes/useApiAmbienteFindOne.ts b/composables/api/ambientes/useApiAmbienteFindOne.ts index e0457a5..2e80250 100644 --- a/composables/api/ambientes/useApiAmbienteFindOne.ts +++ b/composables/api/ambientes/useApiAmbienteFindOne.ts @@ -14,7 +14,7 @@ export const useApiAmbienteFindOne = async ( const id = unref(idRef); if (id) { - return apiClient.ambientes.ambienteFindById({ id: id }); + return apiClient.ambientes.ambienteFindOneById({ id: id }); } return null; diff --git a/composables/api/blocos/useApiBlocosFindOne.ts b/composables/api/blocos/useApiBlocosFindOne.ts index 97b9dc3..e248352 100644 --- a/composables/api/blocos/useApiBlocosFindOne.ts +++ b/composables/api/blocos/useApiBlocosFindOne.ts @@ -12,7 +12,7 @@ export const useApiBlocosFindOne = async ( queryFn: async () => { const id = unref(idRef); if (id) { - return apiClient.blocos.blocoFindById({ + return apiClient.blocos.blocoFindOneById({ id: id, }); } else { diff --git a/composables/api/campus/useApiCampusFindOne.ts b/composables/api/campus/useApiCampusFindOne.ts index c576134..b468301 100644 --- a/composables/api/campus/useApiCampusFindOne.ts +++ b/composables/api/campus/useApiCampusFindOne.ts @@ -12,7 +12,7 @@ export const useApiCampusFindOne = async ( queryFn: async () => { const id = unref(idRef); if (id) { - return apiClient.campi.campusFindById({ + return apiClient.campi.campusFindOneById({ id: id, }); } else { diff --git a/composables/api/cursos/useApiCursosFindOne.ts b/composables/api/cursos/useApiCursosFindOne.ts index 0e3b9c1..034907e 100644 --- a/composables/api/cursos/useApiCursosFindOne.ts +++ b/composables/api/cursos/useApiCursosFindOne.ts @@ -18,7 +18,7 @@ export const useApiCursosFindOne = async ( queryFn: async () => { const id = unref(idRef); if (id) { - return apiClient.cursos.cursoFindById({ + return apiClient.cursos.cursoFindOneById({ id: id, }); } else { diff --git a/composables/api/diarios/useApiDiariosFindOne.ts b/composables/api/diarios/useApiDiariosFindOne.ts index 1ff8531..63b4cd9 100644 --- a/composables/api/diarios/useApiDiariosFindOne.ts +++ b/composables/api/diarios/useApiDiariosFindOne.ts @@ -12,7 +12,7 @@ export const useApiDiariosFindOne = async ( queryFn: async () => { const id = unref(idRef); if (id) { - return apiClient.diarios.diarioDeleteById({ + return apiClient.diarios.diarioDeleteOneById({ id: id, }); } else { diff --git a/composables/api/disciplinas/useApiDisciplinasFindOne.ts b/composables/api/disciplinas/useApiDisciplinasFindOne.ts index f04ef1d..9fc9e7d 100644 --- a/composables/api/disciplinas/useApiDisciplinasFindOne.ts +++ b/composables/api/disciplinas/useApiDisciplinasFindOne.ts @@ -15,7 +15,7 @@ export const useApiDisciplinasFindOne = async ( queryFn: async () => { const id = unref(idRef); if (id) { - return apiClient.disciplinas.disciplinaFindById({ + return apiClient.disciplinas.disciplinaFindOneById({ id: id, }); } else { diff --git a/composables/api/index.ts b/composables/api/index.ts index ec4531c..1baec96 100644 --- a/composables/api/index.ts +++ b/composables/api/index.ts @@ -4,7 +4,7 @@ export * from './campus'; export * from './cursos'; export * from './diarios'; export * from './disciplinas'; -export * from './modalities'; +export * from './ofertasformacoes'; export * from './turmas'; export * from './useApiClient'; export * from './usuarios'; diff --git a/composables/api/modalities/index.ts b/composables/api/modalities/index.ts deleted file mode 100644 index bae9160..0000000 --- a/composables/api/modalities/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './useApiModalitiesFindAll'; -export * from './useApiModalitiesFindOne'; diff --git a/composables/api/modalities/useApiModalitiesFindAll.ts b/composables/api/modalities/useApiModalitiesFindAll.ts deleted file mode 100644 index 3d0f834..0000000 --- a/composables/api/modalities/useApiModalitiesFindAll.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { useQuery } from '@tanstack/vue-query'; - -import { refDebounced } from '@vueuse/core'; - -export const useApiModalitiesFindAll = async (searchTerm: MaybeRef) => { - const apiClient = useApiClient(); - const query = useQuery({ - queryKey: ['modalidade', searchTerm], - - queryFn: async () => { - return apiClient.modalidades.modalidadeList({ - search: unref(searchTerm), - }); - }, - }); - - const modalidade = computed(() => unref(query.data)?.data ?? []); - - const modalidadeDebounced = refDebounced(modalidade, 200); - - await query.suspense(); - - return { - query, - modalidade, - modalidadeDebounced, - }; -}; diff --git a/composables/api/ofertasformacoes/index.ts b/composables/api/ofertasformacoes/index.ts new file mode 100644 index 0000000..3267a3d --- /dev/null +++ b/composables/api/ofertasformacoes/index.ts @@ -0,0 +1,2 @@ +export * from './useApiOfertaFormacaoFindAll'; +export * from './useApiOfertaFormacaoFindOne'; diff --git a/composables/api/ofertasformacoes/useApiOfertaFormacaoFindAll.ts b/composables/api/ofertasformacoes/useApiOfertaFormacaoFindAll.ts new file mode 100644 index 0000000..f84f042 --- /dev/null +++ b/composables/api/ofertasformacoes/useApiOfertaFormacaoFindAll.ts @@ -0,0 +1,28 @@ +import { useQuery } from '@tanstack/vue-query'; + +import { refDebounced } from '@vueuse/core'; + +export const useApiOfertaFormacaoFindAll = async (searchTerm: MaybeRef) => { + const apiClient = useApiClient(); + const query = useQuery({ + queryKey: ['ofertaformacao', searchTerm], + + queryFn: async () => { + return apiClient.ofertasFormacoes.ofertaFormacaoList({ + search: unref(searchTerm), + }); + }, + }); + + const ofertaformacao = computed(() => unref(query.data)?.data ?? []); + + const ofertaformacaoDebounced = refDebounced(ofertaformacao, 200); + + await query.suspense(); + + return { + query, + ofertaformacao, + ofertaformacaoDebounced, + }; +}; diff --git a/composables/api/modalities/useApiModalitiesFindOne.ts b/composables/api/ofertasformacoes/useApiOfertaFormacaoFindOne.ts similarity index 56% rename from composables/api/modalities/useApiModalitiesFindOne.ts rename to composables/api/ofertasformacoes/useApiOfertaFormacaoFindOne.ts index 261063c..3e88b94 100644 --- a/composables/api/modalities/useApiModalitiesFindOne.ts +++ b/composables/api/ofertasformacoes/useApiOfertaFormacaoFindOne.ts @@ -1,21 +1,21 @@ import { useQuery } from '@tanstack/vue-query'; import { computed, unref, type MaybeRef } from 'vue'; -export const useApiModalitiesFindOne = async ( +export const useApiOfertaFormacaoFindOne = async ( idRef: MaybeRef ) => { const apiClient = useApiClient(); const query = useQuery({ queryKey: [ - 'modalidades', - computed(() => `modalidade::id::${unref(idRef)}`), + 'ofertasformacoes', + computed(() => `ofertaformacao::id::${unref(idRef)}`), ], queryFn: async () => { const id = unref(idRef); if (id) { - return apiClient.modalidades.modalidadeFindById({ + return apiClient.ofertasFormacoes.ofertaFormacaoFindOneById({ id: id, }); } else { @@ -24,7 +24,7 @@ export const useApiModalitiesFindOne = async ( }, }); - const modalidade = computed(() => unref(query.data) ?? null); + const ofertaformacao = computed(() => unref(query.data) ?? null); - return { query, modalidade }; + return { query, ofertaformacao }; }; diff --git a/composables/api/turmas/useApiTurmasFindOne.ts b/composables/api/turmas/useApiTurmasFindOne.ts index 0fa02bc..7b30cc2 100644 --- a/composables/api/turmas/useApiTurmasFindOne.ts +++ b/composables/api/turmas/useApiTurmasFindOne.ts @@ -12,7 +12,7 @@ export const useApiTurmasFindOne = async ( queryFn: async () => { const id = unref(idRef); if (id) { - return apiClient.turmas.turmaFindById({ + return apiClient.turmas.turmaFindOneById({ id: id, }); } else { diff --git a/composables/api/usuarios/useApiUsuarioVinculosAtivos.ts b/composables/api/usuarios/useApiUsuarioVinculosAtivos.ts index d015080..730e121 100644 --- a/composables/api/usuarios/useApiUsuarioVinculosAtivos.ts +++ b/composables/api/usuarios/useApiUsuarioVinculosAtivos.ts @@ -16,7 +16,7 @@ export const useApiUsuarioVinculosAtivos = async ( queryFn: async () => { const id = unref(idRef); if (id) { - return apiClient.vinculos.vinculoList({ + return apiClient.perfis.perfilList({ filterUsuarioId: [id], filterAtivo: ['true'], }); diff --git a/composables/api/usuarios/useApiUsuariosFindOne.ts b/composables/api/usuarios/useApiUsuariosFindOne.ts index daf9b7a..1b1b496 100644 --- a/composables/api/usuarios/useApiUsuariosFindOne.ts +++ b/composables/api/usuarios/useApiUsuariosFindOne.ts @@ -12,7 +12,7 @@ export const useApiUsuariosFindOne = async ( queryFn: async () => { const id = unref(idRef); if (id) { - return apiClient.usuarios.usuarioFindById({ + return apiClient.usuarios.usuarioFindOneById({ id: id, }); } else { diff --git a/integrations/api/modules/index.ts b/integrations/api/modules/index.ts index 894e1b4..51a80d0 100644 --- a/integrations/api/modules/index.ts +++ b/integrations/api/modules/index.ts @@ -13,9 +13,9 @@ export * from './useCursosRetriever'; export * from './useDisciplinaGet'; export * from './useDisciplinaGetRetriever'; export * from './useDisciplinasRetriever'; -export * from './useModalidadeGet'; -export * from './useModalidadeGetRetriever'; -export * from './useModalidadesRetriever'; +export * from './useOfertaFormacaoGet'; +export * from './useOfertasFormacoesRetriever'; +export * from './useOfertaFormacaoGetRetriever'; export * from './useTurmaDelete'; export * from './useTurmaGet'; export * from './useTurmaGetRetriever'; diff --git a/integrations/api/modules/useDisciplinaGetRetriever.ts b/integrations/api/modules/useDisciplinaGetRetriever.ts index c1d25d0..1681a1f 100644 --- a/integrations/api/modules/useDisciplinaGetRetriever.ts +++ b/integrations/api/modules/useDisciplinaGetRetriever.ts @@ -2,6 +2,6 @@ export const useDisciplinaGetRetriever = () => { const apiClient = useApiClient(); return (id: string) => { - return apiClient.disciplinas.disciplinaFindById({ id }); + return apiClient.disciplinas.disciplinaFindOneById({ id }); }; }; diff --git a/integrations/api/modules/useModalidadeGet.ts b/integrations/api/modules/useModalidadeGet.ts deleted file mode 100644 index 90a0e95..0000000 --- a/integrations/api/modules/useModalidadeGet.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { useApiBaseResourceGet } from '../base'; -import { useModalidadeGetRetriever } from './useModalidadeGetRetriever'; - -export const useModalidadeGet = async ( - idRef: MaybeRef -) => { - const modalidadeGetRetriever = useModalidadeGetRetriever(); - - return useApiBaseResourceGet({ - id: idRef, - baseQueryKey: ['modalidades'], - apiResourceGetRetriever: modalidadeGetRetriever, - }); -}; diff --git a/integrations/api/modules/useModalidadeGetRetriever.ts b/integrations/api/modules/useModalidadeGetRetriever.ts deleted file mode 100644 index 66beb20..0000000 --- a/integrations/api/modules/useModalidadeGetRetriever.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const useModalidadeGetRetriever = () => { - const apiClient = useApiClient(); - - return (id: string) => { - return apiClient.modalidades.modalidadeFindById({ id }); - }; -}; diff --git a/integrations/api/modules/useModalidadesRetriever.ts b/integrations/api/modules/useModalidadesRetriever.ts deleted file mode 100644 index c759422..0000000 --- a/integrations/api/modules/useModalidadesRetriever.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ModalidadeListData } from '@ladesa-ro/api-client-fetch'; - -export const modalidadesBaseQueryKey = ['modalidades']; - -export const useModalidadesRetriever = () => { - const apiClient = useApiClient(); - - return (data: ModalidadeListData) => { - return apiClient.modalidades.modalidadeList(data); - }; -}; diff --git a/integrations/api/modules/useOfertaFormacaoGet.ts b/integrations/api/modules/useOfertaFormacaoGet.ts new file mode 100644 index 0000000..32a767e --- /dev/null +++ b/integrations/api/modules/useOfertaFormacaoGet.ts @@ -0,0 +1,14 @@ +import { useApiBaseResourceGet } from '../base'; +import { useOfertaFormacaoGetRetriever } from './useOfertaFormacaoGetRetriever'; + +export const useOfertaFormacaoGet = async ( + idRef: MaybeRef +) => { + const OfertaFormacaoGetRetriever = useOfertaFormacaoGetRetriever(); + + return useApiBaseResourceGet({ + id: idRef, + baseQueryKey: ['ofertaformacao'], + apiResourceGetRetriever: OfertaFormacaoGetRetriever, + }); +}; diff --git a/integrations/api/modules/useOfertaFormacaoGetRetriever.ts b/integrations/api/modules/useOfertaFormacaoGetRetriever.ts new file mode 100644 index 0000000..25c9eae --- /dev/null +++ b/integrations/api/modules/useOfertaFormacaoGetRetriever.ts @@ -0,0 +1,7 @@ +export const useOfertaFormacaoGetRetriever = () => { + const apiClient = useApiClient(); + + return (id: string) => { + return apiClient.ofertasFormacoes.ofertaFormacaoFindOneById({ id }); + }; +}; diff --git a/integrations/api/modules/useOfertasFormacoesRetriever.ts b/integrations/api/modules/useOfertasFormacoesRetriever.ts new file mode 100644 index 0000000..cb87b9b --- /dev/null +++ b/integrations/api/modules/useOfertasFormacoesRetriever.ts @@ -0,0 +1,11 @@ +import type { OfertaFormacaoListData } from '@ladesa-ro/api-client-fetch'; + +export const ofertasformacoesBaseQueryKey = ['ofertasformacoes']; + +export const useOfertasFormacoesRetriever = () => { + const apiClient = useApiClient(); + + return (data: OfertaFormacaoListData) => { + return apiClient.ofertasFormacoes.ofertaFormacaoList(data); + }; +}; diff --git a/package-lock.json b/package-lock.json index 26ac653..f8900c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "@auth/core": "^0.37.4", "@ladesa-ro/api-client-fetch": "^1.0.0-alpha.20", "@mdi/font": "^7.3.67", - "@nuxt/devtools": "*", + "@nuxt/devtools": "latest", "@nuxtjs/color-mode": "^3.5.2", "@nuxtjs/tailwindcss": "^6.12.2", "@sidebase/nuxt-auth": "^1.0.0-alpha.0", From f4969756e4e015ae2b0f076fff01d0f0b9e99119 Mon Sep 17 00:00:00 2001 From: Sr-Iury Date: Sat, 23 Nov 2024 23:37:13 -0300 Subject: [PATCH 2/3] fix: partial fix of some bugs :bug: --- components/API/Context/setup-context.ts | 8 +- components/API/Context/typings.ts | 12 +-- components/API/Vinculos/ResumirVinculos.ts | 10 +-- components/Section/Calendario/Forms/Form1.vue | 89 ++++++------------- components/Section/Cursos/Form/Form.vue | 18 ++-- .../Geral/Disciplina/Select/Card/Card.vue | 4 +- .../Disciplina/Turmas/DisciplinaTurmas.vue | 6 +- .../Turmas/Selection/CardTurmas.vue | 6 +- components/Section/Diarios/Grid/Item/Item.vue | 8 +- components/Section/Profile/Profile.vue | 2 +- .../Turmas/Form/-Helpers/useTurmaSubmit.ts | 4 +- .../Periodo/-Helpers/verificar-modalidade.ts | 4 +- .../Turmas/Form/Fields/Periodo/Periodo.vue | 4 +- components/Section/Turmas/Grid/Item/Item.vue | 6 +- .../Section/Usuarios/Form/Profile/Profile.vue | 6 +- .../Section/Usuarios/Grid/Item/Item.vue | 7 +- integrations/api/RoutesUtil.ts | 26 +++--- .../api/modules/useAmbienteGetRetriever.ts | 2 +- .../api/modules/useBlocoGetRetriever.ts | 2 +- .../api/modules/useCampusGetRetriever.ts | 2 +- .../api/modules/useCursoGetRetriever.ts | 2 +- integrations/api/modules/useTurmaDelete.ts | 2 +- .../api/modules/useTurmaGetRetriever.ts | 2 +- 23 files changed, 98 insertions(+), 134 deletions(-) diff --git a/components/API/Context/setup-context.ts b/components/API/Context/setup-context.ts index 8e4dda0..8f8ad85 100644 --- a/components/API/Context/setup-context.ts +++ b/components/API/Context/setup-context.ts @@ -15,7 +15,7 @@ export const createApiContext = (shouldProvide = true) => { data.value?.accessTokenExpires, unref(status), unref(lastRefreshedAt), - ]); + ]); const whoAmIQuery = useQuery({ queryKey: whoAmIQueryKey, @@ -30,10 +30,10 @@ export const createApiContext = (shouldProvide = true) => { const whoAmI = computed(() => whoAmIQuery.data.value ?? null); const usuario = computed(() => whoAmI.value?.usuario ?? null); - const vinculosAtivos = computed(() => whoAmI.value?.vinculosAtivos ?? []); + const perfisAtivos = computed(() => whoAmI.value?.perfisAtivos ?? []); const resumoVinculos = computed(() => { - const todosOsVinculos = vinculosAtivos.value; + const todosOsVinculos = perfisAtivos.value; return resumirVinculos(todosOsVinculos); }); @@ -45,7 +45,7 @@ export const createApiContext = (shouldProvide = true) => { // whoAmI, usuario, - vinculosAtivos, + perfisAtivos, resumoVinculos, // whoAmIQuery, diff --git a/components/API/Context/typings.ts b/components/API/Context/typings.ts index 1dd08e3..bdd640c 100644 --- a/components/API/Context/typings.ts +++ b/components/API/Context/typings.ts @@ -1,15 +1,15 @@ import type { - AuthWhoAmIResultDto, - UsuarioFindOneResultDto, + AuthWhoAmIResponse, + UsuarioFindOneResultView, } from '@ladesa-ro/api-client-fetch'; import type { UseQueryReturnType } from '@tanstack/vue-query'; import type { ResumoVinculos } from '../Vinculos/ResumirVinculos'; export type DynamicWhoAmIResult = - AuthWhoAmIResultDto & { +AuthWhoAmIResponse & { usuario: Strict extends true - ? UsuarioFindOneResultDto - : UsuarioFindOneResultDto | null; + ? AuthWhoAmIResponse + : UsuarioFindOneResultView | null; }; export type IApiContext< @@ -20,7 +20,7 @@ export type IApiContext< resumoVinculos: ComputedRef; whoAmI: ComputedRef; usuario: ComputedRef; - vinculosAtivos: ComputedRef; + vinculosAtivos: ComputedRef; // whoAmIQuery: UseQueryReturnType; }; diff --git a/components/API/Vinculos/ResumirVinculos.ts b/components/API/Vinculos/ResumirVinculos.ts index 875b2ff..dc66bc8 100644 --- a/components/API/Vinculos/ResumirVinculos.ts +++ b/components/API/Vinculos/ResumirVinculos.ts @@ -1,6 +1,6 @@ import type { - CampusFindOneResultDto, - VinculoFindOneResultDto, + CampusFindOneResultView, + PerfilFindOneResultView } from '@ladesa-ro/api-client-fetch'; import { type Dictionary } from 'lodash'; import groupBy from 'lodash/groupBy'; @@ -22,7 +22,7 @@ export type ResumoVinculos = { * } */ mapaCargoCampi: { - [x: string]: CampusFindOneResultDto[]; + [x: string]: CampusFindOneResultView[]; }; /** @@ -31,10 +31,10 @@ export type ResumoVinculos = { * professor: VinculoFindOneResultDto[] * } */ - mapaCargoVinculos: Dictionary; + mapaCargoVinculos: Dictionary; }; -export const resumirVinculos = (todosOsVinculos: VinculoFindOneResultDto[]) => { +export const resumirVinculos = (todosOsVinculos: PerfilFindOneResultView[]) => { const cargos = uniq(map(todosOsVinculos, 'cargo')); const mapaCargoVinculos = groupBy( diff --git a/components/Section/Calendario/Forms/Form1.vue b/components/Section/Calendario/Forms/Form1.vue index 50c4dc8..be977a2 100644 --- a/components/Section/Calendario/Forms/Form1.vue +++ b/components/Section/Calendario/Forms/Form1.vue @@ -1,7 +1,7 @@