Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename descriptionEditable to description_overwrite with backwards compatibility #275

Open
3 tasks
wei opened this issue Apr 13, 2024 · 1 comment
Open
3 tasks
Projects

Comments

@wei
Copy link
Owner

wei commented Apr 13, 2024

  • Rename to descriptionEditable to description_overwrite to prettify url as snake_case is preferred over camelCase in urls.
  • Keep backwards compatibility so existing urls with descriptionEditable will still function as normal.
  • Instead of description_overwrite, Perhaps we can rename all variables to much shorter url parameters like i=1&f=1&d=1&do=Description%20Overwrite&t=Dark

descriptionEditable: string

if (value && value.state === true && value.editable) {
urlParams[key] = '1'
urlParams[`${key}Editable`] = value.value
} else if (value && value.state === true) {
urlParams[key] = '1'
} else if (value && value.required === true) {
urlParams[key] = value.val
} else {
urlParams[key] = '0'
}
if (!urlParams[key] || urlParams[key] === '0') {
delete urlParams[key]
if (`${key}Editable` in urlParams) {
delete urlParams[`${key}Editable`]
}
}

if (currentConfig?.editable) {
const editableValue = params.get(`${key}Editable`)
if (editableValue != null) {
Object.assign(newChange, {
value: editableValue
})
}
}

This will come handy when adding language override too (#69)

@wei wei added this to To do in Socialify via automation Apr 13, 2024
@wei
Copy link
Owner Author

wei commented Apr 13, 2024

@CryogenicPlanet wdyt? any other suggestion to make the query string parameter looking nicer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant