Skip to content

Commit 7f80751

Browse files
committed
feat: use api
1 parent dfb7d0f commit 7f80751

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

backend/pkd/database/dbconnection.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818

1919
"gorm.io/driver/postgres"
2020
"gorm.io/gorm"
21+
"gorm.io/gorm/logger"
2122
"gorm.io/gorm/schema"
2223
)
2324

@@ -26,10 +27,12 @@ var DB *gorm.DB
2627
func ConnectToDB() {
2728
var err error
2829
dsn := os.Getenv("DB_PARAMS")
30+
2931
DB, err = gorm.Open(postgres.Open(dsn), &gorm.Config{
3032
NamingStrategy: schema.NamingStrategy{
3133
SingularTable: true,
3234
},
35+
Logger: logger.Default.LogMode(logger.Error),
3336
})
3437

3538
if err != nil {
File renamed without changes.

frontend/app/location-modal/location-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { type UserDataState} from "../GlobalState";
1616
import { useMemo,useEffect,useState,type FormEvent, type ChangeEvent,type SyntheticEvent } from "react";
1717
import {Box,TextField,Button,Dialog,DialogContent, Autocomplete} from '@mui/material';
1818
import styles from './location-modal.module.css';
19-
import { fetchLocation, postLocationRadius } from "../service/http-client";
19+
import { fetchLocation, postLocationRadius } from "../api/http-client";
2020
import { type PostCodeLocation } from "../model/location";
2121
import { type UserRequest } from "../model/user";
2222
import { useAtom } from "jotai";

frontend/app/login/login.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import GlobalState, { type UserDataState } from "~/GlobalState";
1818
import styles from './login.module.css';
1919
import { useAtom } from "jotai";
2020
import type { FormEvent, BaseSyntheticEvent, ChangeEventHandler } from "react";
21-
import { postLogin, postSignin } from "~/service/http-client";
21+
import { postLogin, postSignin } from "~/api/http-client";
2222
import type { UserResponse } from "~/model/user";
2323
import '../i18n/config';
2424
import { useTranslation, Trans } from 'react-i18next';

frontend/app/main/main.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import GlobalState from '../GlobalState';
1919
//import styles from './main.module.css';
2020
import Chart from '../chart/chart';
2121
import { useNavigate } from 'react-router';
22-
import { fetchGasStations, fetchPriceAvgs, fetchTimeSlots, fetchUserNotifications } from '../service/http-client';
22+
import { fetchGasStations, fetchPriceAvgs, fetchTimeSlots, fetchUserNotifications } from '../api/http-client';
2323
import { type TimeSlot } from '../model/time-slot-response';
2424
import { type GsValue } from '../model/gs-point';
2525
import { type MyDataJson } from '../model/my-data-json';
@@ -39,7 +39,6 @@ export default function Main() {
3939
const [globalJwtTokenState, setGlobalJwtTokenState] = useAtom(GlobalState.jwtTokenState);
4040
const [globalUserUuidState, setGlobalUserUuidState] = useAtom(GlobalState.userUuidState);
4141
const [globalUserDataState, setGlobalUserDataState] = useAtom(GlobalState.userDataState);
42-
const [refreshJwtTokenState, setRefreshJwtTokenState] = useAtom(GlobalState.jwtTokenState);
4342

4443
const handleTabChange = (event: SyntheticEvent, newValue: number) => {
4544
setValue(newValue);

frontend/app/target-price-modal/target-price-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as React from 'react';
1414
import GlobalState from "../GlobalState";
1515
import { Box, TextField, Button, Dialog, DialogContent } from '@mui/material';
1616
import { useState, useMemo, type ChangeEventHandler, type FormEvent } from "react";
17-
import { postTargetPrices } from "../service/http-client";
17+
import { postTargetPrices } from "../api/http-client";
1818
import { type UserRequest } from "../model/user";
1919
import { useAtom } from 'jotai';
2020
import { useTranslation } from 'node_modules/react-i18next';

0 commit comments

Comments
 (0)