mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 21:29:13 +00:00
Encode uri components when sending automations data to the server
This commit is contained in:
@@ -500,19 +500,19 @@ function EditCard(props: EditCardProps) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let updateQueryUrl = `/api/automation?`;
|
let updateQueryUrl = `/api/automation?`;
|
||||||
updateQueryUrl += `q=${values.queryToRun}`;
|
updateQueryUrl += `q=${encodeURIComponent(values.queryToRun)}`;
|
||||||
if (automation?.id && !props.createNew) {
|
if (automation?.id && !props.createNew) {
|
||||||
updateQueryUrl += `&automation_id=${automation.id}`;
|
updateQueryUrl += `&automation_id=${encodeURIComponent(automation.id)}`;
|
||||||
}
|
}
|
||||||
if (values.subject) {
|
if (values.subject) {
|
||||||
updateQueryUrl += `&subject=${values.subject}`;
|
updateQueryUrl += `&subject=${encodeURIComponent(values.subject)}`;
|
||||||
}
|
}
|
||||||
updateQueryUrl += `&crontime=${cronFrequency}`;
|
updateQueryUrl += `&crontime=${encodeURIComponent(cronFrequency)}`;
|
||||||
if (props.locationData) {
|
if (props.locationData) {
|
||||||
updateQueryUrl += `&city=${props.locationData.city}`;
|
updateQueryUrl += `&city=${encodeURIComponent(props.locationData.city)}`;
|
||||||
updateQueryUrl += `®ion=${props.locationData.region}`;
|
updateQueryUrl += `®ion=${encodeURIComponent(props.locationData.region)}`;
|
||||||
updateQueryUrl += `&country=${props.locationData.country}`;
|
updateQueryUrl += `&country=${encodeURIComponent(props.locationData.country)}`;
|
||||||
updateQueryUrl += `&timezone=${props.locationData.timezone}`;
|
updateQueryUrl += `&timezone=${encodeURIComponent(props.locationData.timezone)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
let method = props.createNew ? "POST" : "PUT";
|
let method = props.createNew ? "POST" : "PUT";
|
||||||
|
|||||||
Reference in New Issue
Block a user