-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
slug validation and added a view page
- Loading branch information
1 parent
0b70f81
commit 9d3b296
Showing
4 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
<script lang="ts"> | ||
export let data; | ||
</script> | ||
|
||
<h2>Exercise splits</h2> | ||
|
||
<div class="h-px flex flex-col grow overflow-y-auto"></div> | ||
<div class="h-px flex flex-col grow overflow-y-auto gap-1"> | ||
{#each data.exerciseSplits as exerciseSplit} | ||
<a class="flex p-2 bg-primary rounded-md" href="/exerciseSplits/view/{exerciseSplit._id}"> | ||
<span class="font-semibold">{exerciseSplit.name}</span> | ||
</a> | ||
{/each} | ||
</div> | ||
<a class="btn btn-accent" href="/exerciseSplits/templates">Create new split</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export const load = async ({ fetch }) => { | ||
const response = await fetch("/api/exerciseSplits"); | ||
if (response.ok) { | ||
return { exerciseSplits: (await response.json()) as ExerciseSplit[] }; | ||
return { exerciseSplits: (await response.json()) as WithSID<ExerciseSplit>[] }; | ||
} | ||
return { exerciseSplits: [] }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.