refactor(db): merge exposed and domain with app.config
This commit is contained in:
parent
dbd616c04b
commit
c83f6f57b4
2 changed files with 18 additions and 4 deletions
|
@ -113,8 +113,8 @@ export const AppDetailsContainer: React.FC<IProps> = ({ app }) => {
|
||||||
const updateAvailable = Number(app.version || 0) < Number(app?.latestVersion || 0);
|
const updateAvailable = Number(app.version || 0) < Number(app?.latestVersion || 0);
|
||||||
|
|
||||||
const handleInstallSubmit = async (values: FormValues) => {
|
const handleInstallSubmit = async (values: FormValues) => {
|
||||||
const { exposed, domain, ...form } = values;
|
const { exposed, domain } = values;
|
||||||
install.mutate({ id: app.id, form, exposed, domain });
|
install.mutate({ id: app.id, form: values, exposed, domain });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUnistallSubmit = () => {
|
const handleUnistallSubmit = () => {
|
||||||
|
@ -130,8 +130,8 @@ export const AppDetailsContainer: React.FC<IProps> = ({ app }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUpdateSettingsSubmit = async (values: FormValues) => {
|
const handleUpdateSettingsSubmit = async (values: FormValues) => {
|
||||||
const { exposed, domain, ...form } = values;
|
const { exposed, domain } = values;
|
||||||
updateConfig.mutate({ id: app.id, form, exposed, domain });
|
updateConfig.mutate({ id: app.id, form: values, exposed, domain });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUpdateSubmit = async () => {
|
const handleUpdateSubmit = async () => {
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
-- For all apps that have a domain or exposed field set merge those values into the config jsonb
|
||||||
|
UPDATE
|
||||||
|
app
|
||||||
|
SET
|
||||||
|
config = jsonb_set(config, '{domain}', to_jsonb (DOMAIN))
|
||||||
|
WHERE
|
||||||
|
DOMAIN IS NOT NULL;
|
||||||
|
|
||||||
|
UPDATE
|
||||||
|
app
|
||||||
|
SET
|
||||||
|
config = jsonb_set(config, '{exposed}', to_jsonb (exposed))
|
||||||
|
WHERE
|
||||||
|
exposed IS NOT NULL;
|
Loading…
Reference in a new issue