fix: NaN Error while generating

Signed-off-by: Avior <f.bouillon@aptatio.com>
This commit is contained in:
Florian Bouillon 2022-12-07 16:19:40 +01:00
parent d3963900e7
commit 9e81ea201d
Signed by: Florian Bouillon
GPG Key ID: E05B3A94178D3A7C
2 changed files with 7 additions and 1 deletions

View File

@ -30,6 +30,8 @@ RUN npm run build
RUN npm ci --omit=dev
ENV NODE_ENV=production
# Expose port
EXPOSE 3000

View File

@ -60,7 +60,7 @@ export const generateThingy = async (username: string, filterYear?: number): Pro
if (month === '') {
continue
}
correctedData[month] = Array(31).fill(0)
correctedData[month] = Array(32).fill(0)
}
// loop through each dates
@ -104,6 +104,10 @@ export const generateThingy = async (username: string, filterYear?: number): Pro
final += `text = "${username}";\n`
final += `year = "${filterYear}";\n`
if (process.env.NODE_ENV !== 'production') {
console.log(final)
}
// Fetch the CAD file
let cadPath = './3d.scad'
if (!await exists(cadPath)) {