mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-24 15:29:36 +02:00
Merge pull request #155 from seanmorley15/development
refactor: Update API request in ActivityComplete.svelte and add adven…
This commit is contained in:
commit
1c0d29f5b7
2 changed files with 13 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import type { PageData } from './$types';
|
||||
|
||||
export let data: PageData;
|
||||
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue