Skip to content

Commit

Permalink
feat: updated work_experience schema
Browse files Browse the repository at this point in the history
  • Loading branch information
bbtgnn committed Feb 26, 2024
1 parent a910213 commit 9cc01e0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export const collections = {
work_experiences: T.Object({
date_start: F.DateString('yyyy-MM'),
// TODO - this union doesn't work with static decode!
date_end: T.Union([F.DateString('yyyy-MM'), T.Literal('oggi')]),
date_end: T.Optional(F.DateString('yyyy-MM')),
current: T.Optional(T.Boolean()),
organization: F.Relation('organizations')
})
} satisfies Record<CollectionName, TAnySchema>;
Expand Down
6 changes: 2 additions & 4 deletions src/routes/(collections)/organizations/dyne/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@

<p>Mo bellissima dyne</p>

<pre>{JSON.stringify(data, null, 2)}</pre>

<img src="./logo.jpeg" alt="dyne logo" />

{#await db.get('organizations', 'dyne') then res}
<pre>{JSON.stringify(res, null, 2)}</pre>
{:catch e}
<pre>{JSON.stringify(e)}</pre>
{/await}

<img src="./logo.jpeg" alt="dyne logo" />
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export const data = db.create('work_experiences', {
date_start: '2019-07',
date_end: 'oggi',
current: true,
organization: 'freelance'
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export const data = db.create('work_experiences', {
date_start: '2021-05',
date_end: 'oggi',
current: true,
organization: 'sos'
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
export const data = db.create('work_experiences', {
date_start: '2022-10',
date_end: 'oggi',
current: true,
organization: 'dyne'
});
</script>

<pre>{JSON.stringify(data, null, 2)}</pre>

<hr />

{#await db.get('work_experiences', '2022-10_oggi_dyne') then res}
<pre>{JSON.stringify(res, null, 2)}</pre>
{:catch e}
<pre>{JSON.stringify(e, null, 2)}</pre>
{/await}

0 comments on commit 9cc01e0

Please sign in to comment.