Fixed typo in Dockerfile. Added some checks to weather module settings

This commit is contained in:
unknown 2021-06-09 22:26:39 +02:00
parent 4583ca00e9
commit 80c807bfba
2 changed files with 12 additions and 2 deletions

View file

@ -2,9 +2,9 @@ FROM node:14-alpine
WORKDIR /app
COPY package*.json .
COPY package*.json ./
RUN npm install --only=production
RUN npm install --production
COPY . .

View file

@ -64,6 +64,15 @@ const WeatherSettings = (props: ComponentProps): JSX.Element => {
const formSubmitHandler = (e: FormEvent) => {
e.preventDefault();
// Check for api key input
if ((formData.lat || formData.long) && !formData.WEATHER_API_KEY) {
props.createNotification({
title: 'Warning',
message: 'API Key is missing. Weather Module will NOT work'
})
}
// Save settings
axios.put<ApiResponse<{}>>('/api/config', formData)
.then(() => {
props.createNotification({
@ -111,6 +120,7 @@ const WeatherSettings = (props: ComponentProps): JSX.Element => {
target='blank'>
{' '}Weather API
</a>
. Key is required for weather module to work.
</span>
</InputGroup>
<InputGroup>