Merge pull request #48 from web3privacy/dw/bug-fixes

Fixed fundings and removed ratings from dto
This commit is contained in:
Dominik Wane 2024-09-30 05:48:38 -07:00 committed by GitHub
commit 92749aaa06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -11,7 +11,7 @@ type Fundings = {
}
function useFundings(project?: Partial<Project>) {
const fundings = ref<Fundings[]>(project?.funding as Fundings[] || [])
const fundings = ref<Fundings[]>(Array.isArray(project?.funding) ? project?.funding as unknown as Fundings[] : [project?.funding as unknown as Fundings])
const newFunding = reactive<Fundings>({
name: '',
link: '',
@ -59,7 +59,7 @@ defineExpose({
<ProjectCreateComponentsItem
v-for="funding in fundings"
:key="funding.name"
@remove="() => removeFunding(fundings.indexOf(funding))"
@remove="() => removeFunding(fundings?.indexOf(funding))"
>
<template #label>
<div

View file

@ -10,6 +10,7 @@ export const useProject = defineStore('project', () => {
function setProject(id: string) {
project.value = getProjectById(id, { shallow: false }) as Project
delete project.value.ratings
}
function clearProject() {