mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Encode uri components when sending automations data to the server
This commit is contained in:
parent
387b7c7887
commit
fa4d808a5f
1 changed files with 8 additions and 8 deletions
|
@ -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";
|
||||||
|
|
Loading…
Reference in a new issue