From accda2f16ed66bce665fe9c952aaf85932c0771c Mon Sep 17 00:00:00 2001 From: a-ill Date: Thu, 20 Jul 2023 00:37:48 +0300 Subject: [PATCH] Debug --- Server/app/resources/basic/BasicController.jl | 8 +--- .../svelte/src/groups-add-component.svelte | 5 +- .../js/components/groups-add-component.js | 46 +++++++++---------- 3 files changed, 26 insertions(+), 33 deletions(-) diff --git a/Server/app/resources/basic/BasicController.jl b/Server/app/resources/basic/BasicController.jl index c14756d..138d464 100644 --- a/Server/app/resources/basic/BasicController.jl +++ b/Server/app/resources/basic/BasicController.jl @@ -212,16 +212,10 @@ function political_compass() end function groups_add_post() - @info rawpayload() data = collect(JSON3.read(rawpayload())) push!(data,1) dict = Dict(zip(["country","state","town","latitude","longitude","contact","members"],data)) insert_into_table("groups",dict) end -end - -#= -json_string = """["United States","California",null,38.24508142880928,-120.58593750000001,""]""" -data = JSON3.read(json_string)ยด -=# \ No newline at end of file +end \ No newline at end of file diff --git a/Server/app/svelte/src/groups-add-component.svelte b/Server/app/svelte/src/groups-add-component.svelte index 6959c5f..ffbc7d7 100644 --- a/Server/app/svelte/src/groups-add-component.svelte +++ b/Server/app/svelte/src/groups-add-component.svelte @@ -5,7 +5,7 @@ import { onMount } from 'svelte' import { writable } from 'svelte/store'; import { groupsByCountry, addMarkersGroups } from '/js/groups.js' - import { loadLocaleContent, getData, sendData } from "/js/libraries/serverTools.js" + import { loadLocaleContent, getData, sendText } from "/js/libraries/serverTools.js" // Import components import "/js/components/map-component.js" @@ -92,8 +92,7 @@ if (addressVec!=undefined) { let data = [...addressVec,userPinLat,userPinLng,contactInput.value] let url = "/" + locale + "/groups-add-post/" - sendData(url,data) - + sendText(url,JSON.stringify(data)) } } diff --git a/Server/public/js/components/groups-add-component.js b/Server/public/js/components/groups-add-component.js index 75917d7..5fc78ff 100644 --- a/Server/public/js/components/groups-add-component.js +++ b/Server/public/js/components/groups-add-component.js @@ -3,14 +3,14 @@ import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, c as validate_store, e as component_subscribe, o as onMount, f as empty, n as noop, h as detach_dev, C as binding_callbacks, k as element, l as space, m as add_location, p as attr_dev, q as src_url_equal, r as set_custom_element_data, u as append_dev, y as listen_dev } from './index-d19aafba.js'; import { w as writable } from './index-4664ced0.js'; import { groupsByCountry, addMarkersGroups } from '../../../../../../../../../js/groups.js'; -import { loadLocaleContent, getData, sendData } from '../../../../../../../../../js/libraries/serverTools.js'; +import { loadLocaleContent, getData, sendText } from '../../../../../../../../../js/libraries/serverTools.js'; import '../../../../../../../../../js/components/map-component.js'; /* src\groups-add-component.svelte generated by Svelte v3.52.0 */ const file = "src\\groups-add-component.svelte"; -// (107:4) {#if $loaded==2} +// (106:4) {#if $loaded==2} function create_if_block(ctx) { let div1; let div0; @@ -77,38 +77,38 @@ function create_if_block(ctx) { button.textContent = "Submit"; t16 = space(); map_component = element("map-component"); - add_location(h1, file, 110, 16, 3502); + add_location(h1, file, 109, 16, 3516); attr_dev(img, "id", "groups-img"); if (!src_url_equal(img.src, img_src_value = "/img/common/groups.svg")) attr_dev(img, "src", img_src_value); attr_dev(img, "alt", "groups"); - add_location(img, file, 111, 16, 3540); + add_location(img, file, 110, 16, 3554); attr_dev(p, "class", "description"); - add_location(p, file, 112, 16, 3621); - add_location(li0, file, 114, 20, 3759); - add_location(li1, file, 115, 20, 3840); - add_location(li2, file, 116, 20, 3948); - add_location(ol, file, 113, 16, 3733); + add_location(p, file, 111, 16, 3635); + add_location(li0, file, 113, 20, 3773); + add_location(li1, file, 114, 20, 3854); + add_location(li2, file, 115, 20, 3962); + add_location(ol, file, 112, 16, 3747); attr_dev(label0, "for", "address-input"); - add_location(label0, file, 118, 16, 4039); + add_location(label0, file, 117, 16, 4053); attr_dev(input0, "id", "address-input"); attr_dev(input0, "type", "text"); input0.readOnly = true; - add_location(input0, file, 118, 61, 4084); - add_location(br, file, 118, 133, 4156); + add_location(input0, file, 117, 61, 4098); + add_location(br, file, 117, 133, 4170); attr_dev(label1, "for", "contact-input"); - add_location(label1, file, 119, 16, 4178); + add_location(label1, file, 118, 16, 4192); attr_dev(input1, "id", "contact-input"); attr_dev(input1, "type", "text"); - add_location(input1, file, 119, 60, 4222); + add_location(input1, file, 118, 60, 4236); attr_dev(button, "id", "submit-button"); - add_location(button, file, 120, 16, 4303); + add_location(button, file, 119, 16, 4317); set_custom_element_data(map_component, "id", "map"); set_custom_element_data(map_component, "callback", map_component_callback_value = /*func*/ ctx[10]); - add_location(map_component, file, 121, 16, 4389); + add_location(map_component, file, 120, 16, 4403); attr_dev(div0, "id", "text-container"); - add_location(div0, file, 109, 12, 3459); + add_location(div0, file, 108, 12, 3473); attr_dev(div1, "id", "container"); - add_location(div1, file, 107, 8, 3356); + add_location(div1, file, 106, 8, 3370); }, m: function mount(target, anchor) { insert_dev(target, div1, anchor); @@ -162,14 +162,14 @@ function create_if_block(ctx) { block, id: create_if_block.name, type: "if", - source: "(107:4) {#if $loaded==2}", + source: "(106:4) {#if $loaded==2}", ctx }); return block; } -// (106:0) {#key $loaded} +// (105:0) {#key $loaded} function create_key_block(ctx) { let if_block_anchor; let if_block = /*$loaded*/ ctx[2] == 2 && create_if_block(ctx); @@ -207,7 +207,7 @@ function create_key_block(ctx) { block, id: create_key_block.name, type: "key", - source: "(106:0) {#key $loaded}", + source: "(105:0) {#key $loaded}", ctx }); @@ -354,7 +354,7 @@ function instance($$self, $$props, $$invalidate) { if (addressVec != undefined) { let data = [...addressVec, userPinLat, userPinLng, contactInput.value]; let url = "/" + locale + "/groups-add-post/"; - sendData(url, data); + sendText(url, JSON.stringify(data)); } } @@ -391,7 +391,7 @@ function instance($$self, $$props, $$invalidate) { addMarkersGroups, loadLocaleContent, getData, - sendData, + sendText, loaded, content, addressInput,