Adding date to submitted questions, sqlite insert fixes

This commit is contained in:
mrfry 2021-10-06 19:13:15 +02:00
parent e561cc871b
commit db51e5f202
5 changed files with 12 additions and 6 deletions

View file

@ -31,9 +31,14 @@ makeNextSubmodule() {
npm audit fix
npm run export
popd
ln -sf "$PWD/submodules/${1}/out" "$PWD/nextStatic/${2}"
linkTarget="$PWD/nextStatic/${2}"
if [ ! -f "${linkTarget}" ]; then
ln -sf "$PWD/submodules/${1}/out" "${linkTarget}"
fi
}
./setup.sh
log "Making project"
npm install
npm audit fix

View file

@ -21,11 +21,9 @@ elif [ "$1" == "stop" ]; then
docker stop $(getContainerId)
elif [ "$1" == "start" ]; then
# --entrypoint bash \
scripts/setup.sh
docker start -i $(getContainerId)
elif [ "$1" == "run" ]; then
# --entrypoint bash \
scripts/setup.sh
docker run -it \
-p 8080:80 \
--mount src="$(pwd)/stats",target=/server/stats,type=bind \

View file

@ -131,7 +131,7 @@ function setup(data: SubmoduleData): void {
const msgObj = {
sender: userid,
reciever: parseInt(reciever),
msg: msg,
msg: msg.replace(/'/g, '').replace(/;/g, ''),
type: type || 'text',
date: new Date().getTime(),
unread: 1,

View file

@ -214,7 +214,10 @@ function processIncomingRequestUsingDb(
3
)
logger.DebugLog(currentQuestion, 'isadding', 3)
addQuestion(qdb.data, sName, currentQuestion)
addQuestion(qdb.data, sName, {
...currentQuestion,
date: new Date(),
})
})
currWrites++

@ -1 +1 @@
Subproject commit 11e7c5c5679457e999a95bd24b80108f6d7811ab
Subproject commit 2b491e6bec6eee78400e3e042418def12df3243f