Skip to content

Commit

Permalink
Merge pull request #155 from seanmorley15/development
Browse files Browse the repository at this point in the history
refactor: Update API request in ActivityComplete.svelte and add adven…
  • Loading branch information
seanmorley15 authored Aug 1, 2024
2 parents 331f25e + db9e771 commit 1c0d29f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 7 additions & 1 deletion frontend/src/lib/components/ActivityComplete.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
}
onMount(async () => {
let res = await fetch('/api/activity-types/types/');
let res = await fetch('/api/activity-types/types/', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
let data = await res.json();
console.log('ACTIVITIES' + data);
if (data) {
allActivities = data;
}
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/routes/activities/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { goto } from '$app/navigation';
import type { PageData } from './$types';
export let data: PageData;
Expand All @@ -19,12 +20,11 @@
<tr>
<td>{activity}</td>
<td>
<!-- <button
class="btn btn-sm btn-error"
on:click={() => {
activities = activities.filter((a) => a !== activity);
}}>Remove</button
> -->
<button
class="btn btn-sm btn-primary"
on:click={() => goto(`/search?query=${activity}&property=activity_types`)}
>See Adventures</button
>
</td>
</tr>
{/each}
Expand Down

0 comments on commit 1c0d29f

Please sign in to comment.