From 031f8ea020a97cebc148307e1b8d6aafcdf3185b Mon Sep 17 00:00:00 2001 From: thomlamb Date: Fri, 11 Oct 2024 14:34:00 +0200 Subject: [PATCH] Fix query --- .../CampaignContent/CampaignContent.jsx | 31 ++++++++++++++++--- .../Campaign/CampaignList/CampaignList.jsx | 4 +-- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/imio/smartweb/core/webcomponents/src/components/Campaign/CampaignContent/CampaignContent.jsx b/src/imio/smartweb/core/webcomponents/src/components/Campaign/CampaignContent/CampaignContent.jsx index d2cf3f3c..d2aff847 100644 --- a/src/imio/smartweb/core/webcomponents/src/components/Campaign/CampaignContent/CampaignContent.jsx +++ b/src/imio/smartweb/core/webcomponents/src/components/Campaign/CampaignContent/CampaignContent.jsx @@ -1,17 +1,38 @@ import { useNavigate } from "react-router-dom"; import React, { useEffect, useState, useRef } from "react"; +import useAxios from "../../../hooks/useAxios"; import useFilterQuery from "../../../hooks/useFilterQuery"; +import moment from "moment"; +import ReactMarkdown from "react-markdown"; +import Spotlight from "spotlight.js"; +import "../../../../node_modules/flexbin/flexbin.css"; +import { Translate } from "react-translated"; import queryString from "query-string"; const ContactContent = (props) => { let navigate = useNavigate(); + const { u, ...parsed } = Object.assign({ + id: queryString.parse(useFilterQuery().toString())["u"], + b_start: 0, + }); + const [params, setParams] = useState(parsed); const [item, setitem] = useState({}); const modalRef = useRef(); - - function handleClick() { - navigate(".."); - onChange(null); - } + const { response, error, isLoading } = useAxios( + { + method: "get", + url: "", + baseURL: props.queryUrl, + headers: { + Accept: "application/json", + }, + params: params, + }, + [] + ); + useEffect(() => { + setParams(parsed); + }, [queryString.parse(useFilterQuery().toString())["u"]]); return (
diff --git a/src/imio/smartweb/core/webcomponents/src/components/Campaign/CampaignList/CampaignList.jsx b/src/imio/smartweb/core/webcomponents/src/components/Campaign/CampaignList/CampaignList.jsx index d15032c2..f1e9bc0c 100644 --- a/src/imio/smartweb/core/webcomponents/src/components/Campaign/CampaignList/CampaignList.jsx +++ b/src/imio/smartweb/core/webcomponents/src/components/Campaign/CampaignList/CampaignList.jsx @@ -19,9 +19,9 @@ const NewsList = (props) => { .replace(/[^a-zA-Z ]/g, "") .replace(/\s/g, "-") .toLowerCase(), - search: `?u=${item.uuid}`, + search: `?u=${item.id}`, state: { - idItem: item.uuid, + idItem: item.id, }, }} >