diff --git a/webapp/src/clj/lipas/backend/ptv/handler.clj b/webapp/src/clj/lipas/backend/ptv/handler.clj index b24f9927a..d240917f4 100644 --- a/webapp/src/clj/lipas/backend/ptv/handler.clj +++ b/webapp/src/clj/lipas/backend/ptv/handler.clj @@ -6,9 +6,9 @@ (defn localized-string-schema [string-props] [:map {:closed true} - [:fi [:string string-props]] - [:se [:string string-props]] - [:en [:string string-props]]]) + [:fi {:optional true} [:string string-props]] + [:se {:optional true} [:string string-props]] + [:en {:optional true} [:string string-props]]]) (def integration-enum [:enum "lipas-managed" "manual"]) diff --git a/webapp/src/clj/lipas/backend/ptv/integration.clj b/webapp/src/clj/lipas/backend/ptv/integration.clj index ebc8e71eb..1a9954b3d 100644 --- a/webapp/src/clj/lipas/backend/ptv/integration.clj +++ b/webapp/src/clj/lipas/backend/ptv/integration.clj @@ -193,7 +193,6 @@ [ptv service-location] (let [org-id (-> service-location :organizationId) params {:url (make-url ptv "/v11/ServiceChannel/ServiceLocation") - :auth-org-id org-id :method :post :form-params service-location}] (log/info "Create PTV service location" service-location) @@ -286,6 +285,9 @@ (get-org-service-channels ptv* org-id*) + (http ptv* org-id* {:url (make-url ptv* "/v11/ServiceChannel/b4abd13e-0d36-4ff9-a6c9-94f2f5aee036") + :method :get}) + ;; Delete all org service locations (doseq [x (:itemList (get-org-service-channels ptv* org-id*))] (update-service-location ptv* (:id x) {:organizationId org-id* diff --git a/webapp/src/cljs/lipas/ui/ptv/subs.cljs b/webapp/src/cljs/lipas/ui/ptv/subs.cljs index 966c2dd04..2f5b6b063 100644 --- a/webapp/src/cljs/lipas/ui/ptv/subs.cljs +++ b/webapp/src/cljs/lipas/ui/ptv/subs.cljs @@ -115,6 +115,13 @@ :service-name service-name :service-modified (:modified service) :service-channels (->> service :serviceChannels (map :serviceChannel)) + :city-codes (->> service + :areas + (mapcat (fn [{:keys [type municipalities]}] + (when (= "Municipality" type) + municipalities))) + (map (comp parse-long :code)) + vec) :ontology-terms (->> service :ontologyTerms (map (fn [m] diff --git a/webapp/src/cljs/lipas/ui/ptv/views.cljs b/webapp/src/cljs/lipas/ui/ptv/views.cljs index a8ebfe85d..e46bc9974 100644 --- a/webapp/src/cljs/lipas/ui/ptv/views.cljs +++ b/webapp/src/cljs/lipas/ui/ptv/views.cljs @@ -695,17 +695,12 @@ org-languages (ptv-data/org-id->languages org-id) ;; Turn the PTV Service data structure back to Lipas API call for save! data {:org-id org-id - :city-codes (->> service - :areas - (some (fn [{:keys [type municipalities]}] - (when (= "Municipality" type) - municipalities))) - vals - (map :code)) + :source-id source-id + :city-codes (:city-codes service) :sub-category-id (ptv-data/parse-service-source-id (:source-id service)) :languages org-languages - :summary (:summary descriptions) - :description (:description descriptions)}] + :summary (or (:summary descriptions) (:summary service)) + :description (or (:description descriptions) (:description service))}] [lui/expansion-panel {:label (:label service)} [mui/stack {:spacing 2} [mui/stack {:direction "row" :spacing 2}