Skip to content

Commit

Permalink
fix: import error
Browse files Browse the repository at this point in the history
  • Loading branch information
bbtgnn committed Mar 1, 2024
1 parent d143669 commit 602b0b3
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 8 deletions.
13 changes: 12 additions & 1 deletion src/_modules/dao/base_document_handling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,18 @@ export function parse_base_document<T extends TAnySchema>(
},
catch: () => {
const errors = [...Value.Errors(schema, base_document.props)];
return new Error(`Parse error: ${base_document.path} \n ${JSON.stringify(errors, null, 2)}`);
return new Error(`
Parse error:
${base_document.path}
Provided value:
${JSON.stringify(base_document.props, null, 2)}
Errors:
${JSON.stringify(errors, null, 2)}
`);
}
});
}
2 changes: 1 addition & 1 deletion src/_modules/dao/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function create<C extends CollectionName>(
Effect.flatMap((schema) =>
Effect.try({
try: () => Value.Decode(schema, data),
catch: () => new Error(`Invalid data`)
catch: () => new Error(`Invalid data: ${JSON.stringify(data, null, 2)}`)
})
),
Effect.runSync
Expand Down
4 changes: 3 additions & 1 deletion src/_modules/database_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Type as T } from '@sinclair/typebox';

export const database_index_schema = T.Object({
education: T.Union([T.Literal('maturita-scientifica-sante-simone'), T.Literal('triennio-isia-urbino')]),
organizations: T.Union([T.Literal('axant'), T.Literal('dyne'), T.Literal('ff3300'), T.Literal('forkbomb'), T.Literal('freelance'), T.Literal('la-scuola-open-source'), T.Literal('studio-ardito')]),
organizations: T.Union([T.Literal('axant'), T.Literal('dyne'), T.Literal('ff3300'), T.Literal('forkbomb'), T.Literal('freelance'), T.Literal('isia-urbino'), T.Literal('la-scuola-open-source'), T.Literal('liceo-scientifico-s-simone'), T.Literal('studio-ardito')]),
projects: T.Union([T.Literal('join'), T.Literal('reaction-diffusion'), T.Literal('scabec'), T.Literal('signroom')]),
work_experiences: T.Union([T.Literal('axant-ui-designer.svelte'), T.Literal('developer-dyne'), T.Literal('developer-forkbomb'), T.Literal('developer-sos'), T.Literal('ff3300-developer'), T.Literal('freelance-multi'), T.Literal('freelance-teacher'), T.Literal('sos-information-manager'), T.Literal('sos-workshop-organizer'), T.Literal('studio-ardito-designer')])
})
Expand All @@ -18,7 +18,9 @@ export const database_index = {
"ff3300",
"forkbomb",
"freelance",
"isia-urbino",
"la-scuola-open-source",
"liceo-scientifico-s-simone",
"studio-ardito"
],
"projects": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
export const props = db.create('education', {
date_start: '2008-09',
date_end: '2014-07',
institution: "Liceo Scientifico 'S. Simone'",
description: 'Diploma di maturità scientifica, 100/100 e Lode'
institution: 'liceo-scientifico-s-simone',
title: 'Diploma di maturità scientifica',
description: 'Votazione conseguita di 100/100 con lode'
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
export const props = db.create('education', {
date_start: '2016-09',
date_end: '2020-07',
institution: 'ISIA Urbino',
description: 'Laurea triennale in progettazione grafica e comunicazione visiva, 110/110 e Lode'
institution: 'isia-urbino',
title: 'Laurea triennale in progettazione grafica e comunicazione visiva',
description: 'Laurea conseguita con votazione di 110/110 e Lode'
});
</script>
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="ts">
<script lang="ts" context="module">
import { db } from '$modules';
export const props = db.create('work_experiences', {
Expand Down

0 comments on commit 602b0b3

Please sign in to comment.