Fix editSetting key value.
Signed-off-by: Armored Dragon <publicmail@armoreddragon.com>feature/profile
parent
299c1de74e
commit
537f5afa72
|
@ -13,7 +13,5 @@ COPY . .
|
||||||
EXPOSE 5004
|
EXPOSE 5004
|
||||||
|
|
||||||
COPY wait-for-db.sh /usr/local/bin/wait-for-db.sh
|
COPY wait-for-db.sh /usr/local/bin/wait-for-db.sh
|
||||||
|
|
||||||
RUN chmod +x /usr/local/bin/wait-for-db.sh
|
RUN chmod +x /usr/local/bin/wait-for-db.sh
|
||||||
|
CMD ["/usr/local/bin/wait-for-db.sh"]
|
||||||
CMD ["/usr/local/bin/wait-for-db.sh"]
|
|
|
@ -626,10 +626,11 @@ async function editSetting({ name, value }) {
|
||||||
if (!Object.keys(settings).includes(name)) return _r(false, "Setting is not valid");
|
if (!Object.keys(settings).includes(name)) return _r(false, "Setting is not valid");
|
||||||
|
|
||||||
await prisma.setting.upsert({ where: { id: name }, update: { value: value }, create: { id: name, value: value } });
|
await prisma.setting.upsert({ where: { id: name }, update: { value: value }, create: { id: name, value: value } });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
settings[key] = JSON.parse(value);
|
settings[name] = JSON.parse(value);
|
||||||
} catch {
|
} catch {
|
||||||
settings[key] = value;
|
settings[name] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _r(true);
|
return _r(true);
|
||||||
|
|
|
@ -22,6 +22,12 @@ deploy_migrations() {
|
||||||
npx prisma migrate deploy
|
npx prisma migrate deploy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to push the Prisma database
|
||||||
|
push_database() {
|
||||||
|
echo "Pushing the database..."
|
||||||
|
npx prisma db push
|
||||||
|
}
|
||||||
|
|
||||||
# Wait for the database to be ready
|
# Wait for the database to be ready
|
||||||
wait_for_db
|
wait_for_db
|
||||||
|
|
||||||
|
@ -31,6 +37,9 @@ generate_prisma
|
||||||
# Deploy Prisma migrations
|
# Deploy Prisma migrations
|
||||||
deploy_migrations
|
deploy_migrations
|
||||||
|
|
||||||
|
# Push the database
|
||||||
|
push_database
|
||||||
|
|
||||||
# Start the application
|
# Start the application
|
||||||
echo "Starting the application..."
|
echo "Starting the application..."
|
||||||
npm start
|
npm start
|
Loading…
Reference in New Issue