First search request attempt
This commit is contained in:
@@ -15,12 +15,17 @@ export default class extends Controller {
|
||||
*
|
||||
* @param {Event} event
|
||||
*/
|
||||
submitSearch(event) {
|
||||
async submitSearch(event) {
|
||||
event.preventDefault();
|
||||
const data = new FormData(event.target);
|
||||
const body = {};
|
||||
|
||||
for (const entry of data.entries()) {
|
||||
console.log(entry[0]);
|
||||
body[entry[0]] = entry[1];
|
||||
}
|
||||
|
||||
const response = await fetch("https://caprigis-api.ddev.site:33001/search?" + new URLSearchParams(body));
|
||||
|
||||
console.debug(await response.json(), body);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user