mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +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?`;
|
||||
updateQueryUrl += `q=${values.queryToRun}`;
|
||||
updateQueryUrl += `q=${encodeURIComponent(values.queryToRun)}`;
|
||||
if (automation?.id && !props.createNew) {
|
||||
updateQueryUrl += `&automation_id=${automation.id}`;
|
||||
updateQueryUrl += `&automation_id=${encodeURIComponent(automation.id)}`;
|
||||
}
|
||||
if (values.subject) {
|
||||
updateQueryUrl += `&subject=${values.subject}`;
|
||||
updateQueryUrl += `&subject=${encodeURIComponent(values.subject)}`;
|
||||
}
|
||||
updateQueryUrl += `&crontime=${cronFrequency}`;
|
||||
updateQueryUrl += `&crontime=${encodeURIComponent(cronFrequency)}`;
|
||||
if (props.locationData) {
|
||||
updateQueryUrl += `&city=${props.locationData.city}`;
|
||||
updateQueryUrl += `®ion=${props.locationData.region}`;
|
||||
updateQueryUrl += `&country=${props.locationData.country}`;
|
||||
updateQueryUrl += `&timezone=${props.locationData.timezone}`;
|
||||
updateQueryUrl += `&city=${encodeURIComponent(props.locationData.city)}`;
|
||||
updateQueryUrl += `®ion=${encodeURIComponent(props.locationData.region)}`;
|
||||
updateQueryUrl += `&country=${encodeURIComponent(props.locationData.country)}`;
|
||||
updateQueryUrl += `&timezone=${encodeURIComponent(props.locationData.timezone)}`;
|
||||
}
|
||||
|
||||
let method = props.createNew ? "POST" : "PUT";
|
||||
|
|
Loading…
Reference in a new issue