Properly convert communication API objects
Gets rid of a warning when showing relative time.
This commit is contained in:
parent
a2b8527d91
commit
63ebe382b6
2 changed files with 5 additions and 3 deletions
|
|
@ -183,7 +183,7 @@ function selectCommunication(communication: Communication) {
|
|||
}
|
||||
|
||||
// Computed properties
|
||||
const filteredCommunications = computed(() => {
|
||||
const filteredCommunications = computed((): Communication[] => {
|
||||
if (props.all == null) {
|
||||
return [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { Communication } from "@/type/api";
|
||||
import { Communication, CommunicationDTO } from "@/type/api";
|
||||
import { SSEManager, SSEMessage } from "@/SSEManager";
|
||||
import { useSessionStore } from "@/store/session";
|
||||
|
||||
|
|
@ -38,7 +38,9 @@ export const useCommunicationStore = defineStore("communication", () => {
|
|||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
const data = await response.json();
|
||||
all.value = data.communications;
|
||||
all.value = data.communications.map((c: CommunicationDTO) =>
|
||||
Communication.fromJSON(c),
|
||||
);
|
||||
return data.communications;
|
||||
} catch (err) {
|
||||
console.error("Error loading communications:", err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue