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
|
||||
|
||||
COPY wait-for-db.sh /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");
|
||||
|
||||
await prisma.setting.upsert({ where: { id: name }, update: { value: value }, create: { id: name, value: value } });
|
||||
|
||||
try {
|
||||
settings[key] = JSON.parse(value);
|
||||
settings[name] = JSON.parse(value);
|
||||
} catch {
|
||||
settings[key] = value;
|
||||
settings[name] = value;
|
||||
}
|
||||
|
||||
return _r(true);
|
||||
|
|
|
@ -22,6 +22,12 @@ deploy_migrations() {
|
|||
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_db
|
||||
|
||||
|
@ -31,6 +37,9 @@ generate_prisma
|
|||
# Deploy Prisma migrations
|
||||
deploy_migrations
|
||||
|
||||
# Push the database
|
||||
push_database
|
||||
|
||||
# Start the application
|
||||
echo "Starting the application..."
|
||||
npm start
|
Loading…
Reference in New Issue