API Documentation
POST
/api/database/post
This request will get all the posts in de database of a given page. A post will be given in the first place if the its id is given as the showcase variable.
## Request

const { data: requestData } = await useFetch("/api/database/post", {
  method: "post",
  body: {
    page: page_ctr,
    showcase_id: post_showcase,
  },
});

## Response

{
  "ok": true,
  "posts": [
    {
      "id": "e21fad61-8ab4-4feb-a690-aeec7cac183b",
      "created_at": "2023-12-11T13:27:38.544243+00:00",
      "user_id": "66ac2644-8fe3-47ed-80f4-08e79a896d13",
      "park_id": null,
      "title": "This is the title of a post",
      "content": "This is the content of a post",
      "nr_likes": null,
      "advertisement": false,
      "media": [
        "1702301256878-attraction1.jpg",
        ...
      ],
      "Profiles": {
        "id": "66ac2644-8fe3-47ed-80f4-08e79a896d13",
        "username": "tdegeest"
      },
      "Media": [
        {
          "id": "8e665271-54ff-4ac6-8c91-9fc8e000d1fe",
          "created_at": "2023-12-11T13:27:38.660458+00:00",
          "post_id": "e21fad61-8ab4-4feb-a690-aeec7cac183b",
          "comment_id": null,
          "review_id": null,
          "Likes": [
            {
              "count": 1
            }
          ]
        }
      ],
      "Comments": [
        {
          "count": 7
        }
      ],
      "mediaUrl": [
        "https://jtnchawtwukdbalqjykj.supabase.co/storage/v1/object/public/post-content/1702301256878-attraction1.jpg",
        ...
      ]
    },
    ...
  ],
  "likes": [
    "8e665271-54ff-4ac6-8c91-9fc8e000d1fe",
    ...
  ]
}
DELETE
/api/database/post/[id]
This API call deletes the post that matches the given id.
## Request

let { ok: successful, error: error_remove } = await $fetch(
  `/api/database/post/${props.id}`,
  {
    method: "delete",
  },
);

## Response

{
  "ok": true
}
GET
/api/database/post/[id]
This request will get the post with the given id
## Request

const { data: requestData } = await useFetch(`/api/database/post/${id}`);

## Response

{
  "ok": true,
  "posts": [
    {
      "id": "7f8b7f81-f2cc-4746-ad0f-0f8578dd3b48",
      "created_at": "2023-12-13T19:35:45.050637+00:00",
      "user_id": "1ca0364b-0232-42f8-9932-f2a8227724e2",
      "park_id": null,
      "title": "This is the title of a post",
      "content": "This is the content of a post",
      "nr_likes": null,
      "advertisement": false,
      "media": [
        "1702496144407-Screenshot 2023-12-10 at 19.56.14.png"
      ],
      "Profiles": {
        "id": "1ca0364b-0232-42f8-9932-f2a8227724e2",
        "username": "testuser"
      },
      "Media": [
        {
          "id": "f661adca-5e99-4475-8733-c88cbbf80d21",
          "created_at": "2023-12-13T19:35:45.209828+00:00",
          "post_id": "7f8b7f81-f2cc-4746-ad0f-0f8578dd3b48",
          "comment_id": null,
          "review_id": null,
          "Likes": [
            {
              "count": 3
            }
          ]
        }
      ],
      "Comments": [
        {
          "count": 2
        }
      ],
      "mediaUrl": [
        "https://jtnchawtwukdbalqjykj.supabase.co/storage/v1/object/public/post-content/1702496144407-Screenshot%202023-12-10%20at%2019.56.14.png"
      ]
    }
  ],
  "likes": [
    ...
  ]
}

GET
/api/database/post/[id]/comments
This request will get the the comments that are linked to the given post. In addition all the likes of the current user are given.
## Request

const { data: requestData } = await useFetch(
  `/api/database/post/${id}/comments`,
);

## Response

{
  "ok": true,
  "comments": [
    {
      "id": "9b25fe1d-74c3-4528-99e2-ceab2257d371",
      "created_at": "2023-12-18T22:18:20.231456+00:00",
      "post_id": "3814b94f-b7ef-4487-acf3-c8c753a1463b",
      "user_id": "66ac2644-8fe3-47ed-80f4-08e79a896d13",
      "title": "comment",
      "content": "aze",
      "media": null,
      "Posts": {
        "id": "3814b94f-b7ef-4487-acf3-c8c753a1463b"
      },
      "Profiles": {
        "id": "66ac2644-8fe3-47ed-80f4-08e79a896d13",
        "username": "tdegeest"
      },
      "Media": [
        {
          "id": "7ac097c9-d030-4980-ae5e-28595cfa61e6",
          "created_at": "2023-12-18T22:18:20.426706+00:00",
          "post_id": null,
          "comment_id": "9b25fe1d-74c3-4528-99e2-ceab2257d371",
          "review_id": null,
          "Likes": [
            {
              "count": 1
            }
          ]
        }
      ]
    },
    ...
  ],
  "likes": [
    "f661adca-5e99-4475-8733-c88cbbf80d21",
    ...
  ]
}
POST
/api/database/post/new
This request will create a new post using the data
## Request

let {
  ok: successful,
  data: post,
  error: error_post,
} = await $fetch("/api/database/post/new", {
  method: "post",
  body: {
    title: title,
    content: content,
    media: media_names,
    park_id: park_id,
  },
});

## Response

{
  "ok": true,
  "data": {
    "post_id": "a4c5c5a9-b107-437a-8cce-337ca3a7d3d1"
  },
  "message": "Post created successfully"
}

GET
/api/database/comment
This request will get all the comments in de database
## Request

let { ok: successful, data: response } = await $fetch(
  "/api/database/comment",
  {
    method: "post",
    body: {
      user_id: user_id,
      post_id: id,
      title: postData.value.title,
      content: postData.value.content,
    },
  },
);

## Response

{
  "ok": true,
  "comments": [
    {
      "id": "ef9e69af-5362-46d1-a96e-10260f424b2b",
      "created_at": "2023-12-12T10:11:47.137095+00:00",
      "post_id": "e21fad61-8ab4-4feb-a690-aeec7cac183b",
      "user_id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
      "title": "Awesome Comment",
      "content": "I really enjoyed his park",
      "media": null,
      "Profiles": {
        "id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
        "username": "jackyyyyyy"
      },
      "Media": [
        {
          "id": "d70464e7-595b-4d76-8077-037d42ddac0a",
          "created_at": "2023-12-12T10:11:47.593349+00:00",
          "post_id": null,
          "comment_id": "ef9e69af-5362-46d1-a96e-10260f424b2b",
          "review_id": null,
          "Likes": [
            {
              "count": 1
            }
          ]
        }
      ]
    },
    ...
  ],
  "likes": [
    "8e665271-54ff-4ac6-8c91-9fc8e000d1fe",
    ...
  ]
}
POST
/api/database/comment
This request will create a new comment on a post.
## Request

const { data, pending, error, refresh } = useFetch('/api/database/comment', {
  method: 'POST',
  body: {
    title: "a magnificient title",
    content: "some content",
    post_id: "db35abe8-46a3-4135-979d-f214375d0248",
    user_id: "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
  }
})

## Response

{
  ok: true,
  data: {
    comment_id: "1fc11757-f968-4327-9f45-c16011f95261",
  }
}
POST
/api/database/comment/review
This request will create a new comment on a review.
## Request

const { data, pending, error, refresh } = useFetch('/api/database/comment/review', {
  method: 'POST',
  body: {
    title: "a magnificient title",
    content: "some content",
    review_id: "db35abe8-46a3-4135-979d-f214375d0248",
    user_id: "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
  }
})

## Response

{
  ok: true,
  data: {
    comment_id: "1fc11757-f968-4327-9f45-c16011f95261",
  }
}
GET
/api/database/comment/[id]
This request will return the specific comment tied to the given id.
## Request

const { data, pending, error, refresh } = useFetch('/api/database/comment/:id')

## Response
{
  "ok": true,
  "comments": [
    {
      "id": "da63659c-8531-4888-8276-8e7cfaa6e6eb",
      "created_at": "2023-12-14T10:50:35.264984+00:00",
      "post_id": "f4189458-70e3-4d45-a2ed-908df9fe4baa",
      "user_id": "64d98bbe-2dd0-44d5-8b8e-cbf4a1fd5b67",
      "title": "Vloeken",
      "content": "Ey stop eens een keer met het *****ing vloeken",
      "media": null,
      "review_id": null,
      "Profiles": {
        "id": "64d98bbe-2dd0-44d5-8b8e-cbf4a1fd5b67",
        "username": "machine"
      },
      "Media": [
        {
          "id": "37b1da5f-9ccf-4cab-a679-ee831d966c9b",
          "created_at": "2023-12-14T10:50:35.418794+00:00",
          "post_id": null,
          "comment_id": "da63659c-8531-4888-8276-8e7cfaa6e6eb",
          "review_id": null,
          "Likes": [
            {
              "count": 1
            }
          ]
        }
      ]
    }
  ],
  "likes": [
    "b5c73543-656e-4f77-89b0-5abc487ed049"
  ]
}
POST
/api/database/like
This API call likes / unlikes the given media. It will check the account that sends this message. This API call will fail if the the sender is not logged in.
## Request

const like_action = like_state.value ? "like" : "unlike";
let response = await $fetch("/api/database/like", {
  method: "post",
  body: {
    action: like_action,
    media_id: media_id,
  },
});

## Response

{
  "ok": true,
  "data": "Media liked successfully",
  "new_state": "liked",
  "count": 1
}
GET
/api/database/friends/follower/[id]
This API call gets all the followers of the user with the given id. The returned information about the users do not contain sensitive data.
## Request
let { data: response
} = await useFetch(`/api/database/friends/follower/${id
}`);

## Response
{
    "ok": true,
    "followers": [
        {
            "id": "e2bbb02a-aafa-4729-ae49-46131ce4edb6",
            "updated_at": null,
            "username": "apadi",
            "avatar": "1703021375902-avatar.png",
            "email": null,
            "role": "admin",
            "company_id": null,
            "biography": "Hello world ***** it hello"
        },
        {
            "id": "64d98bbe-2dd0-44d5-8b8e-cbf4a1fd5b67",
            "updated_at": null,
            "username": "machine",
            "avatar": null,
            "email": null,
            "role": "normal_user",
            "company_id": null,
            "biography": null
        },
        {
            "id": "1ca0364b-0232-42f8-9932-f2a8227724e2",
            "updated_at": null,
            "username": "testuser",
            "avatar": null,
            "email": null,
            "role": "normal_user",
            "company_id": null,
            "biography": null
        },
        {
            "id": "695833ec-67ff-4f84-9c62-24147241f3d8",
            "updated_at": null,
            "username": "antoine",
            "avatar": null,
            "email": null,
            "role": "normal_user",
            "company_id": null,
            "biography": null
        }
    ]
}
GET
/api/database/friends/following/[id]
This API call gets all the users that a user with a given id follows. The returned information about the users do not contain sensitive data.
## Request
let { data: response
} = await useFetch(`/api/database/friends/following/${id
}`);

## Response
{
    "ok": true,
    "followers": [
        {
            "id": "66ac2644-8fe3-47ed-80f4-08e79a896d13",
            "updated_at": null,
            "username": "tdegeest",
            "avatar": null,
            "email": null,
            "role": "admin",
            "company_id": null,
            "biography": null
        },
        {
            "id": "e52acd30-26d3-4390-9e40-7ee7b5ad4100",
            "updated_at": null,
            "username": "starky",
            "avatar": null,
            "email": null,
            "role": "normal_user",
            "company_id": null,
            "biography": null
        },
        {
            "id": "695833ec-67ff-4f84-9c62-24147241f3d8",
            "updated_at": null,
            "username": "antoine",
            "avatar": null,
            "email": null,
            "role": "normal_user",
            "company_id": null,
            "biography": null
        }
    ]
}
GET
/api/database/user/[username]
This API call returns all the non-senstive information about the user matching the given username.
## Request
let { user_info, error_flag, error_message, avatar_image
} = await $fetch(`/api/database/user/${username
}`);

## Response, example for username = apadi

{
    "error_flag": false,
    "user_info": {
        "id": "e2bbb02a-aafa-4729-ae49-46131ce4edb6",
        "updated_at": null,
        "username": "apadi",
        "avatar": "1703021375902-avatar.png",
        "email": null,
        "role": "admin",
        "company_id": null,
        "biography": "Hi I'm Apadi!"
    },
    "avatar_image": {
        "publicUrl": "https://jtnchawtwukdbalqjykj.supabase.co/storage/v1/object/public/profile-pictures/1703021375902-avatar.png"
    }
}
GET
/api/database/users/[username]
This API call gets all the usernames matching the given username. It performs a fuzzy search on all the accounts of ThrillTracker.
## Request

let { users, error_flag, error_message
} = await $fetch(`/api/database/users/${username
}`);

## Response, example for username = t

{
    "error_flag": false,
    "users": [
        {
            "username": "antoine"
        },
        {
            "username": "ytr"
        },
        {
            "username": "testuser"
        },
        {
            "username": "usertest"
        },
        {
            "username": "starky"
        },
        {
            "username": "antoin"
        },
        {
            "username": "tdegeest"
        }
    ]
}
GET
/api/weather/daily/[latitude]/[longitude]
This API call gets the weather information at the given place indicated by latitude and logitude. The returned information contains a lot of information about the weather at that place.
## Request

let { weather_data, error_flag, error_message
} = await $fetch(
      `api/weather/daily/${latitude
}/${longitude
}`,
    );

## Response, example for latitude = 50 and longitude = 20

{
    "error_flag": false,
    "weather_data": {
        "location": {
            "name": "Wieliczka",
            "region": "",
            "country": "Poland",
            "lat": 50,
            "lon": 20,
            "tz_id": "Europe/Warsaw",
            "localtime_epoch": 1703006911,
            "localtime": "2023-12-19 18:28"
        },
        "current": {
            "last_updated_epoch": 1703006100,
            "last_updated": "2023-12-19 18:15",
            "temp_c": 6,
            "temp_f": 42.8,
            "is_day": 0,
            "condition": {
                "text": "Clear",
                "icon": "//cdn.weatherapi.com/weather/64x64/night/113.png",
                "code": 1000
            },
            "wind_mph": 9.4,
            "wind_kph": 15.1,
            "wind_degree": 240,
            "wind_dir": "WSW",
            "pressure_mb": 1014,
            "pressure_in": 29.94,
            "precip_mm": 0,
            "precip_in": 0,
            "humidity": 52,
            "cloud": 0,
            "feelslike_c": 2.4,
            "feelslike_f": 36.2,
            "vis_km": 10,
            "vis_miles": 6,
            "uv": 1,
            "gust_mph": 25.4,
            "gust_kph": 40.9
        }
    }
}
GET
/api/weather/forecast/[latitude]/[longitude]/[days]
This API call gets the forecast for the given number of days at the place indicated by latitude and longitude. It returns a lot of weather information for each day.
## Request

let { 
  weather_data,
  error_flag,
  error_message } = await $fetch(`../api/weather/forecast/${latitude}/${longitude}/${days}`);

## Response, example for latitude = 50, longitude = 20 and days = 3

{
    "error_flag": false,
    "weather_data": {
        "location": {
            "name": "Wieliczka",
            "region": "",
            "country": "Poland",
            "lat": 50,
            "lon": 20,
            "tz_id": "Europe/Warsaw",
            "localtime_epoch": 1703006938,
            "localtime": "2023-12-19 18:28"
        },
        "current": {
            "last_updated_epoch": 1703006100,
            "last_updated": "2023-12-19 18:15",
            "temp_c": 6,
            "temp_f": 42.8,
            "is_day": 0,
            "condition": {
                "text": "Clear",
                "icon": "//cdn.weatherapi.com/weather/64x64/night/113.png",
                "code": 1000
            },
            "wind_mph": 9.4,
            "wind_kph": 15.1,
            "wind_degree": 240,
            "wind_dir": "WSW",
            "pressure_mb": 1014,
            "pressure_in": 29.94,
            "precip_mm": 0,
            "precip_in": 0,
            "humidity": 52,
            "cloud": 0,
            "feelslike_c": 2.4,
            "feelslike_f": 36.2,
            "vis_km": 10,
            "vis_miles": 6,
            "uv": 1,
            "gust_mph": 25.4,
            "gust_kph": 40.9
        },
        "forecast": {
            "forecastday": [
                {
                    "date": "2023-12-19",
                    "date_epoch": 1702944000,
                    "day": {
                        "maxtemp_c": 8.7,
                        "maxtemp_f": 47.6,
                        "mintemp_c": 2.8,
                        "mintemp_f": 37,
                        "avgtemp_c": 5.3,
                        "avgtemp_f": 41.5,
                        "maxwind_mph": 10.3,
                        "maxwind_kph": 16.6,
                        "totalprecip_mm": 0,
                        "totalprecip_in": 0,
                        "totalsnow_cm": 0,
                        "avgvis_km": 10,
                        "avgvis_miles": 6,
                        "avghumidity": 60,
                        "daily_will_it_rain": 0,
                        "daily_chance_of_rain": 0,
                        "daily_will_it_snow": 0,
                        "daily_chance_of_snow": 0,
                        "condition": {
                            "text": "Sunny",
                            "icon": "//cdn.weatherapi.com/weather/64x64/day/113.png",
                            "code": 1000
                        },
                        "uv": 3
                    },
                    "astro": {
                        "sunrise": "07:35 AM",
                        "sunset": "03:40 PM",
                        "moonrise": "11:53 AM",
                        "moonset": "11:41 PM",
                        "moon_phase": "First Quarter",
                        "moon_illumination": 41,
                        "is_moon_up": 0,
                        "is_sun_up": 0
                    },
                    "hour": [
                        {
                            "time_epoch": 1702940400,
                            "time": "2023-12-19 00:00",
                            "temp_c": 3.3,
                            "temp_f": 37.9,
                            "is_day": 0,
                            "condition": {
                                "text": "Partly cloudy",
                                "icon": "//cdn.weatherapi.com/weather/64x64/night/116.png",
                                "code": 1003
                            },
                            "wind_mph": 4.9,
                            "wind_kph": 7.9,
                            "wind_degree": 229,
                            "wind_dir": "SW",
                            "pressure_mb": 1027,
                            "pressure_in": 30.33,
                            "precip_mm": 0,
                            "precip_in": 0,
                            "humidity": 72,
                            "cloud": 36,
                            "feelslike_c": 1.1,
                            "feelslike_f": 34.1,
                            "windchill_c": 1.1,
                            "windchill_f": 34.1,
                            "heatindex_c": 3.3,
                            "heatindex_f": 37.9,
                            "dewpoint_c": -1.2,
                            "dewpoint_f": 29.8,
                            "will_it_rain": 0,
                            "chance_of_rain": 0,
                            "will_it_snow": 0,
                            "chance_of_snow": 0,
                            "vis_km": 10,
                            "vis_miles": 6,
                            "gust_mph": 10.3,
                            "gust_kph": 16.6,
                            "uv": 1
                        },
                        ...
                    ]
                },
                ...
            ]
        }
    }
}
GET
/api/database/parks
This API call gets all the parks that our website supports.
## Request

let returnObject = await $fetch("/api/database/parks");

## Response

{
    "ok": true,
    "parks": [
        {
            "id": 97,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Adventure Island",
            "country": "United States",
            "continent": "North America",
            "latitude": "28.04174441",
            "longitude": "-82.4131981",
            "timezone": "America/New_York",
            "description": "dhueuydgeyfefeeifhuefefefefedeuhfyegfe",
            "company_id": 3,
            "media": [],
            "mediaUrl": []
        },
        ...
        {
            "id": 63,
            "created_at": "2023-12-12T14:47:06.696+00:00",
            "name": "Worlds of Fun",
            "country": "United States",
            "continent": "North America",
            "latitude": "39.177333",
            "longitude": "-94.489028",
            "timezone": "America/Chicago",
            "description": "",
            "company_id": 11,
            "media": [],
            "mediaUrl": []
        }
    ],
    "error": null
}
GET
/api/database/parks/[id]
This API call gets all the information about the park that matches the given id.
## Request

const { data: requestData
} = await useFetch(`/api/park-api/parks/${id
}`);

## Response, example for id = 4

{
    "ok": true,
    "park": {
        "id": 4,
        "created_at": "2023-12-12T14:47:06.697+00:00",
        "name": "Disneyland Park Paris",
        "country": "France",
        "continent": "Europe",
        "latitude": "48.8722344",
        "longitude": "2.7758079",
        "timezone": "Europe/Paris",
        "description": "",
        "company_id": 2,
        "media": [],
        "mediaUrl": []
    },
    "error": null
}
GET
/api/database/parks/[id]/review-avarage
This API call gets the average rating of all the reviews on a park
## Request

const { data, pending, error, refresh } =
  useFetch(`/api/database/parks/${id}/review-avarage`);

## Response, example for id = 53

{
  "ok": true,
  "averageRating": 4
}
POST
/api/database/parks/[id]/review
## Request

const { data, pending, error, refresh } = useFetch(`/api/database/parks/${id}/review`, {
  method: 'POST',
  body: {
    page: number,
  }
})

## Response

{
  "ok": true,
  "reviews": [
    {
      "id": "95237e8a-ac0b-4e08-af9f-c17160a0fd63",
      "created_at": "2023-12-20T02:04:18.212+00:00",
      "park_id": 53,
      "user_id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
      "title": "sdfdsf",
      "content": "sdf",
      "rating": 1,
      "media": [],
      "Parks": {
        "id": 53,
        "name": "Walibi Holland"
      },
      "Profiles": {
        "id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
        "username": "jackyyyyyy"
      },
      "Media": [
        {
          "id": "66f027fe-c95f-487d-b0df-f9473fe7858e",
          "created_at": "2023-12-20T02:04:18.603172+00:00",
          "post_id": null,
          "comment_id": null,
          "review_id": "95237e8a-ac0b-4e08-af9f-c17160a0fd63",
          "Likes": [
            {
              "count": 0
            }
          ]
        }
      ],
      "Comments": [
        {
          "count": 0
        }
      ],
      "mediaUrl": []
    },
    {
      "id": "2b7ae03f-b1bc-4ad2-9c0b-b0f923f26973",
      "created_at": "2023-12-20T00:45:12.688881+00:00",
      "park_id": 53,
      "user_id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
      "title": "sdsdsdsdsd",
      "content": "sdds",
      "rating": 3,
      "media": [],
      "Parks": {
        "id": 53,
        "name": "Walibi Holland"
      },
      "Profiles": {
        "id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
        "username": "jackyyyyyy"
      },
      "Media": [
        {
          "id": "b2a9e704-3d5a-4a33-8f95-f6b6cdff3bf8",
          "created_at": "2023-12-20T00:45:12.991675+00:00",
          "post_id": null,
          "comment_id": null,
          "review_id": "2b7ae03f-b1bc-4ad2-9c0b-b0f923f26973",
          "Likes": [
            {
              "count": 0
            }
          ]
        }
      ],
      "Comments": [
        {
          "count": 4
        }
      ],
      "mediaUrl": []
    },
    {
      "id": "af9981de-f7f4-4004-aff0-f7748f77a360",
      "created_at": "2023-12-20T00:39:01.447438+00:00",
      "park_id": 53,
      "user_id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
      "title": "sdfdsf",
      "content": "sdff",
      "rating": 7,
      "media": [],
      "Parks": {
        "id": 53,
        "name": "Walibi Holland"
      },
      "Profiles": {
        "id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
        "username": "jackyyyyyy"
      },
      "Media": [
        {
          "id": "b32dac55-3f94-4a17-a025-bb2465da6060",
          "created_at": "2023-12-20T00:39:01.594754+00:00",
          "post_id": null,
          "comment_id": null,
          "review_id": "af9981de-f7f4-4004-aff0-f7748f77a360",
          "Likes": [
            {
              "count": 0
            }
          ]
        }
      ],
      "Comments": [
        {
          "count": 0
        }
      ],
      "mediaUrl": []
    },
    {
      "id": "ebec3094-da54-424d-9bbb-07b73da4240e",
      "created_at": "2023-12-20T00:37:43.684047+00:00",
      "park_id": 53,
      "user_id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
      "title": "ssdf",
      "content": "sdfs",
      "rating": 5,
      "media": [],
      "Parks": {
        "id": 53,
        "name": "Walibi Holland"
      },
      "Profiles": {
        "id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
        "username": "jackyyyyyy"
      },
      "Media": [
        {
          "id": "5fbc2015-c90b-4494-9830-4babebcaea8b",
          "created_at": "2023-12-20T00:37:43.860726+00:00",
          "post_id": null,
          "comment_id": null,
          "review_id": "ebec3094-da54-424d-9bbb-07b73da4240e",
          "Likes": [
            {
              "count": 0
            }
          ]
        }
      ],
      "Comments": [
        {
          "count": 0
        }
      ],
      "mediaUrl": []
    },
    {
      "id": "6396b280-6299-45a7-a44e-583116351728",
      "created_at": "2023-12-19T20:14:14.646471+00:00",
      "park_id": 53,
      "user_id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
      "title": "First",
      "content": "lolypop",
      "rating": 3,
      "media": [],
      "Parks": {
        "id": 53,
        "name": "Walibi Holland"
      },
      "Profiles": {
        "id": "2fc79d1e-e974-45f7-b943-195dfa8db5a3",
        "username": "jackyyyyyy"
      },
      "Media": [
        {
          "id": "4a9d136a-3abc-4b21-a43f-d9ea61ae7d4e",
          "created_at": "2023-12-19T20:23:05.032917+00:00",
          "post_id": null,
          "comment_id": null,
          "review_id": "6396b280-6299-45a7-a44e-583116351728",
          "Likes": [
            {
              "count": 0
            }
          ]
        }
      ],
      "Comments": [
        {
          "count": 0
        }
      ],
      "mediaUrl": []
    }
  ],
  "likes": []
}
POST
/api/database/parks/[id]/description
## Request

const { data, pending, error, refresh } = useFetch('/api/database/parks/53/description', {
  method: 'POST',
  body: {
    "description": "lolylol",
    "companyId": 15
  }
})

## Response

{
  "ok": true,
  "data": [
    {
      "id": 53,
      "created_at": "2023-12-12T14:47:06.697+00:00",
      "name": "Walibi Holland",
      "country": "Netherlands",
      "continent": "Europe",
      "latitude": "52.44",
      "longitude": "5.7625",
      "timezone": "Europe/Amsterdam",
      "description": "lolylol",
      "company_id": 15,
      "media": []
    }
  ]
}
POST
/api/database/parks/[id]/media
## Request

const { data, pending, error, refresh } = useFetch('/api/database/parks/:id/media', {
  method: 'POST',
  body: [image-3.png]
})

## Response

{
  ok: true,
  data: [1703021375902-image-3.png],
}
GET
/api/database/parks/search/[name]/[filters]
This API call gets all the information about a park with a given name and filters. The filters are filters on the continent of the park. This performs a fuzzy search so it might return multiple parks.
## Request 

let { filtered_parks, error_flag, error_message
} = await $fetch(`/api/database/parks/search/${park_name
}/${active_filters
}`);


## Response, example for name = disney and filters = [
    Europa, Africa
]

{
    "error_flag": false,
    "filtered_parks": [
        {
            "id": 4,
            "created_at": "2023-12-12T14: 47: 06.697+00: 00",
            "name": "Disneyland Park Paris",
            "country": "France",
            "continent": "Europe",
            "latitude": "48.8722344",
            "longitude": "2.7758079",
            "timezone": "Europe/Paris",
            "description": "",
            "company_id": 2,
            "media": []
        },
        {
            "id": 28,
            "created_at": "2023-12-12T14: 47: 06.697+00: 00",
            "name": "Walt Disney Studios Paris",
            "country": "France",
            "continent": "Europe",
            "latitude": "48.8673",
            "longitude": "2.779008",
            "timezone": "Europe/Paris",
            "description": "",
            "company_id": 2,
            "media": []
        }
    ]
}
GET
/api/database/parks/search/name
This API call gets all the information about a park with a given name. This performs a fuzzy search so it might return multiple parks.
## Request

let { parks, error_flag, error_message
} = await $fetch(`/api/database/parks/search/${park_name
}`);


## Response, example for name = disney

{
    "error_flag": false,
    "parks": [
        {
            "id": 17,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Disney California Adventure",
            "country": "United States",
            "continent": "North America",
            "latitude": "33.8058755",
            "longitude": "-117.9194899",
            "timezone": "America/Los_Angeles",
            "description": "",
            "company_id": 2,
            "media": []
        },
        {
            "id": 7,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Disney Hollywood Studios",
            "country": "United States",
            "continent": "North America",
            "latitude": "28.3575294",
            "longitude": "-81.5582714",
            "timezone": "America/New_York",
            "description": "",
            "company_id": 2,
            "media": []
        },
        {
            "id": 6,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Disney Magic Kingdom",
            "country": "United States",
            "continent": "North America",
            "latitude": "28.417663",
            "longitude": "-81.581212",
            "timezone": "America/New_York",
            "description": "",
            "company_id": 2,
            "media": []
        },
        {
            "id": 16,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Disneyland",
            "country": "United States",
            "continent": "North America",
            "latitude": "33.8104856",
            "longitude": "-117.9190001",
            "timezone": "America/Los_Angeles",
            "description": "",
            "company_id": 2,
            "media": []
        },
        {
            "id": 31,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Disneyland Hong Kong",
            "country": "Hong Kong",
            "continent": "Asia",
            "latitude": "22.3133",
            "longitude": "114.0433",
            "timezone": "Asia/Hong_Kong",
            "description": "",
            "company_id": 2,
            "media": []
        },
        {
            "id": 4,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Disneyland Park Paris",
            "country": "France",
            "continent": "Europe",
            "latitude": "48.8722344",
            "longitude": "2.7758079",
            "timezone": "Europe/Paris",
            "description": "",
            "company_id": 2,
            "media": []
        },
        {
            "id": 30,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Shanghai Disney Resort",
            "country": "China",
            "continent": "Asia",
            "latitude": "31.144",
            "longitude": "121.657",
            "timezone": "Asia/Shanghai",
            "description": "",
            "company_id": 2,
            "media": []
        },
        {
            "id": 274,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Tokyo Disneyland",
            "country": "Japan",
            "continent": "Asia",
            "latitude": "35.634848",
            "longitude": "139.879295",
            "timezone": "Asia/Tokyo",
            "description": "",
            "company_id": 2,
            "media": []
        },
        {
            "id": 275,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Tokyo DisneySea",
            "country": "Japan",
            "continent": "Asia",
            "latitude": "35.627055",
            "longitude": "139.889097",
            "timezone": "Asia/Tokyo",
            "description": "",
            "company_id": 2,
            "media": []
        },
        {
            "id": 28,
            "created_at": "2023-12-12T14:47:06.697+00:00",
            "name": "Walt Disney Studios Paris",
            "country": "France",
            "continent": "Europe",
            "latitude": "48.8673",
            "longitude": "2.779008",
            "timezone": "Europe/Paris",
            "description": "",
            "company_id": 2,
            "media": []
        }
    ]
}
GET
/api/database/companies
This call returns all the companies
## Request

const { data, pending, error, refresh } = useFetch('/api/database/companies')

## Response

{
  "ok": true,
  "companies": [
    {
      "id": 9,
      "created_at": "2023-11-21T15:21:41.383+00:00",
      "name": "Other"
    },
    {
      "id": 11,
      "created_at": "2023-11-28T13:37:20.067+00:00",
      "name": "Cedar Fair Entertainment Company"
    },
    {
      "id": 15,
      "created_at": "2023-11-28T13:37:20.067+00:00",
      "name": "Compagnie des Alpes"
    },
    {
      "id": 10,
      "created_at": "2023-11-28T13:37:20.067+00:00",
      "name": "Herschend Family Entertainment"
    },
    {
      "id": 19,
      "created_at": "2023-11-28T13:37:20.067+00:00",
      "name": "Looping Group"
    },
    {
      "id": 17,
      "created_at": "2023-11-28T13:37:20.067+00:00",
      "name": "Mack Rides"
    },
    {
      "id": 6,
      "created_at": "2023-11-28T13:37:20.067+00:00",
      "name": "Merlin Entertainments"
    },
    {
      "id": 18,
      "created_at": "2023-11-28T13:37:20.068+00:00",
      "name": "Parques Reunidos"
    },
    {
      "id": 16,
      "created_at": "2023-11-28T13:37:20.068+00:00",
      "name": "Plopsa"
    },
    {
      "id": 14,
      "created_at": "2023-11-28T13:37:20.068+00:00",
      "name": "PortAventura World"
    },
    {
      "id": 3,
      "created_at": "2023-11-28T13:37:20.068+00:00",
      "name": "SeaWorld Parks & Entertainment"
    },
    {
      "id": 1,
      "created_at": "2023-11-28T13:37:20.068+00:00",
      "name": "Six Flags Entertainment Corporation"
    },
    {
      "id": 20,
      "created_at": "2023-11-28T13:37:20.068+00:00",
      "name": "UK National Museums"
    },
    {
      "id": 12,
      "created_at": "2023-11-28T13:37:20.068+00:00",
      "name": "Universal Parks & Resorts"
    },
    {
      "id": 2,
      "created_at": "2023-11-28T13:37:20.068+00:00",
      "name": "Walt Disney Attractions"
    }
  ],
  "error": null
}
GET
/api/database/companies/[id]/parks
This returns all the parks of the given id.
## Request

const { data, pending, error, refresh } = useFetch('/api/database/companies/:id/parks')

## Response


  "ok": true,
  "data": [
    {
      "id": 54,
      "created_at": "2023-12-12T14:47:06.697+00:00",
      "name": "Plopsaland De Panne",
      "country": "Belgium",
      "continent": "Europe",
      "latitude": "51.079722",
      "longitude": "2.596944",
      "timezone": "Europe/Brussels",
      "description": "",
      "company_id": 16,
      "media": []
    },
    {
      "id": 302,
      "created_at": "2023-12-12T14:47:06.697+00:00",
      "name": "Holiday Park",
      "country": "Germany",
      "continent": "Europe",
      "latitude": "49.319722",
      "longitude": "8.294722",
      "timezone": "Europe/Berlin",
      "description": "dizejhduehfuhefhehfkjedsgfjsdhgfgdsfygeyf zufegf ygezyfg zeuyg fyg zeyfkg kjdygsfy gsdyfg dsgf yseyf es\ndizejhduehfuhefhehfkjedsgfjsdhgfgdsfygeyf zufegf ygezyfg zeuyg fyg zeyfkg kjdygsfy gsdyfg dsgf yseyf es\ndizejhduehfuhefhehfkjedsgfjsdhgfgdsfygeyf zufegf ygezyfg zeuyg fyg zeyfkg kjdygsfy gsdyfg dsgf yseyf es\ndizejhduehfuhefhehfkjedsgfjsdhgfgdsfygeyf zufegf ygezyfg zeuyg fyg zeyfkg kjdygsfy gsdyfg dsgf yseyf es\ndizejhduehfuhefhehfkjedsgfjsdhgfgdsfygeyf zufegf ygezyfg zeuyg fyg zeyfkg kjdygsfy gsdyfg dsgf yseyf es\ndizejhduehfuhefhehfkjedsgfjsdhgfgdsfygeyf zufegf ygezyfg zeuyg fyg zeyfkg kjdygsfy gsdyfg dsgf yseyf es\ndizejhduehfuhefhehfkjedsgfjsdhgfgdsfygeyf zufegf ygezyfg zeuyg fyg zeyfkg kjdygsfy gsdyfg dsgf yseyf es\ndizejhduehfuhefhehfkjedsgfjsdhgfgdsfygeyf zufegf ygezyfg zeuyg fyg zeyfkg kjdygsfy gsdyfg dsgf yseyf es\n\n\nthis is amazing",
      "company_id": 16,
      "media": [
        "1702981080425-test.png",
        "1702990162011-21090b3564fa45f85a578cfccdeb82783c7f61f2r1-1400-1400v2_uhq.jpg"
      ]
    }
  ]
}
POST
/api/database/review
This request will get all the reviews in de database of a given page. A review will be given in the first place if the its id is given as the showcase variable.
## Request

const { data: requestData } = await useFetch("/api/database/review", {
  method: "review",
  body: {
    page: page_ctr,
    showcase_id: review_showcase,
  },
});

## Response

{
  "ok": true,
  "reviews": [
    {
      "id": "e21fad61-8ab4-4feb-a690-aeec7cac183b",
      "created_at": "2023-12-11T13:27:38.544243+00:00",
      "user_id": "66ac2644-8fe3-47ed-80f4-08e79a896d13",
      "park_id": null,
      "title": "This is the title of a review",
      "content": "This is the content of a review",
      "nr_likes": null,
      "advertisement": false,
      "media": [
        "1702301256878-attraction1.jpg",
        ...
      ],
      "Profiles": {
        "id": "66ac2644-8fe3-47ed-80f4-08e79a896d13",
        "username": "tdegeest"
      },
      "Media": [
        {
          "id": "8e665271-54ff-4ac6-8c91-9fc8e000d1fe",
          "created_at": "2023-12-11T13:27:38.660458+00:00",
          "review_id": "e21fad61-8ab4-4feb-a690-aeec7cac183b",
          "comment_id": null,
          "review_id": null,
          "Likes": [
            {
              "count": 1
            }
          ]
        }
      ],
      "Comments": [
        {
          "count": 7
        }
      ],
      "mediaUrl": [
        "https://jtnchawtwukdbalqjykj.supabase.co/storage/v1/object/public/review-content/1702301256878-attraction1.jpg",
        ...
      ]
    },
    ...
  ],
  "likes": [
    "8e665271-54ff-4ac6-8c91-9fc8e000d1fe",
    ...
  ]
}
DELETE
/api/database/review/[id]
This API call deletes the review that matches the given id.
## Request

let { ok: successful, error: error_remove } = await $fetch(
  `/api/database/review/${props.id}`,
  {
    method: "delete",
  },
);

## Response

{
  "ok": true
}
GET
/api/database/review/[id]
This request will get the review with the given id
## Request

const { data: requestData } = await useFetch(`/api/database/review/${id}`);

## Response

{
  "ok": true,
  "reviews": [
    {
      "id": "7f8b7f81-f2cc-4746-ad0f-0f8578dd3b48",
      "created_at": "2023-12-13T19:35:45.050637+00:00",
      "user_id": "1ca0364b-0232-42f8-9932-f2a8227724e2",
      "park_id": null,
      "title": "This is the title of a review",
      "content": "This is the content of a review",
      "nr_likes": null,
      "advertisement": false,
      "media": [
        "1702496144407-Screenshot 2023-12-10 at 19.56.14.png"
      ],
      "Profiles": {
        "id": "1ca0364b-0232-42f8-9932-f2a8227724e2",
        "username": "testuser"
      },
      "Media": [
        {
          "id": "f661adca-5e99-4475-8733-c88cbbf80d21",
          "created_at": "2023-12-13T19:35:45.209828+00:00",
          "review_id": "7f8b7f81-f2cc-4746-ad0f-0f8578dd3b48",
          "comment_id": null,
          "review_id": null,
          "Likes": [
            {
              "count": 3
            }
          ]
        }
      ],
      "Comments": [
        {
          "count": 2
        }
      ],
      "mediaUrl": [
        "https://jtnchawtwukdbalqjykj.supabase.co/storage/v1/object/public/review-content/1702496144407-Screenshot%202023-12-10%20at%2019.56.14.png"
      ]
    }
  ],
  "likes": [
    ...
  ]
}

GET
/api/database/review/[id]/comments
This request will get the the comments that are linked to the given review. In addition all the likes of the current user are given.
## Request

const { data: requestData } = await useFetch(
  `/api/database/review/${id}/comments`,
);

## Response

{
  "ok": true,
  "comments": [
    {
      "id": "9b25fe1d-74c3-4528-99e2-ceab2257d371",
      "created_at": "2023-12-18T22:18:20.231456+00:00",
      "review_id": "3814b94f-b7ef-4487-acf3-c8c753a1463b",
      "user_id": "66ac2644-8fe3-47ed-80f4-08e79a896d13",
      "title": "comment",
      "content": "aze",
      "media": null,
      "Reviews": {
        "id": "3814b94f-b7ef-4487-acf3-c8c753a1463b"
      },
      "Profiles": {
        "id": "66ac2644-8fe3-47ed-80f4-08e79a896d13",
        "username": "tdegeest"
      },
      "Media": [
        {
          "id": "7ac097c9-d030-4980-ae5e-28595cfa61e6",
          "created_at": "2023-12-18T22:18:20.426706+00:00",
          "review_id": null,
          "comment_id": "9b25fe1d-74c3-4528-99e2-ceab2257d371",
          "review_id": null,
          "Likes": [
            {
              "count": 1
            }
          ]
        }
      ]
    },
    ...
  ],
  "likes": [
    "f661adca-5e99-4475-8733-c88cbbf80d21",
    ...
  ]
}
POST
/api/database/review/new
This request will create a new review using the data
## Request

let {
  ok: successful,
  data: review,
  error: error_review,
} = await $fetch("/api/database/review/new", {
  method: "review",
  body: {
    title: title,
    content: content,
    media: media_names,
    park_id: park_id,
  },
});

## Response

{
  "ok": true,
  "data": {
    "review_id": "a4c5c5a9-b107-437a-8cce-337ca3a7d3d1"
  },
  "message": "Review created successfully"
}