Compare commits
2 Commits
main
...
fr/testing
Author | SHA1 | Date | |
---|---|---|---|
82a24efd91 | |||
5f29773b4a |
23
api/.gitea/workflows/build.yaml
Normal file
23
api/.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
name: Build DeguApp backend
|
||||||
|
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js and TypeScript
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "20.14.0"
|
||||||
|
|
||||||
|
- name: npm install, build and test
|
||||||
|
run: |
|
||||||
|
npm install
|
||||||
|
npm run build --if-present
|
||||||
|
npm run test
|
||||||
|
|
@ -41,3 +41,5 @@ app.use(cookieParser());
|
|||||||
|
|
||||||
// Routes
|
// Routes
|
||||||
app.use(routes);
|
app.use(routes);
|
||||||
|
|
||||||
|
//test
|
||||||
|
@ -18,7 +18,7 @@ export default function BeerAdd() {
|
|||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [items, setItems] = useState([
|
const [items, setItems] = useState([
|
||||||
{ label: "Tank beer", value: "tank" },
|
{ label: "Tank beer", value: "tank" },
|
||||||
{ label: "Keg beer", value: "keg" },
|
{ label: "Cask beer", value: "cask" },
|
||||||
{ label: "Glass bottle", value: "glass" },
|
{ label: "Glass bottle", value: "glass" },
|
||||||
{ label: "Can", value: "can" },
|
{ label: "Can", value: "can" },
|
||||||
{ label: "PET bottle", value: "pet" },
|
{ label: "PET bottle", value: "pet" },
|
||||||
|
@ -19,7 +19,7 @@ export default function reviewAdd() {
|
|||||||
const [openSourness, setOpenSourness] = useState(false);
|
const [openSourness, setOpenSourness] = useState(false);
|
||||||
const [openAgain, setOpenAgain] = useState(false);
|
const [openAgain, setOpenAgain] = useState(false);
|
||||||
|
|
||||||
// foam
|
// pěna
|
||||||
const [itemFoam, setFoamValue] = useState(null);
|
const [itemFoam, setFoamValue] = useState(null);
|
||||||
const [foam, setFoam] = useState([
|
const [foam, setFoam] = useState([
|
||||||
{
|
{
|
||||||
@ -54,11 +54,11 @@ export default function reviewAdd() {
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// bitter / sweetness
|
// hořkost / sladkost
|
||||||
const [itemBitter_sweetness, setBitter_sweetnessValue] = useState(null);
|
const [itemBitter_sweetness, setBitter_sweetnessValue] = useState(null);
|
||||||
const [bitter_sweetness, setBitter_sweetness] = useState([
|
const [bitter_sweetness, setBitter_sweetness] = useState([
|
||||||
{
|
{
|
||||||
label: "Bitter",
|
label: "Bad",
|
||||||
value: "1",
|
value: "1",
|
||||||
icon: () => (
|
icon: () => (
|
||||||
<Image
|
<Image
|
||||||
@ -78,7 +78,7 @@ export default function reviewAdd() {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Sweet",
|
label: "Excellent",
|
||||||
value: "3",
|
value: "3",
|
||||||
icon: () => (
|
icon: () => (
|
||||||
<Image
|
<Image
|
||||||
@ -89,7 +89,7 @@ export default function reviewAdd() {
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// taste
|
//chuť
|
||||||
const [itemTaste, setTasteValue] = useState(null);
|
const [itemTaste, setTasteValue] = useState(null);
|
||||||
const [taste, setTaste] = useState([
|
const [taste, setTaste] = useState([
|
||||||
{
|
{
|
||||||
@ -199,7 +199,7 @@ export default function reviewAdd() {
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// sourness
|
//kyselost
|
||||||
const [itemSourness, setSournessValue] = useState(null);
|
const [itemSourness, setSournessValue] = useState(null);
|
||||||
const [sourness, setSourness] = useState([
|
const [sourness, setSourness] = useState([
|
||||||
{
|
{
|
||||||
@ -224,7 +224,7 @@ export default function reviewAdd() {
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// would again
|
//dal bych si znovu?
|
||||||
const [itemAgain, setAgainValue] = useState(null);
|
const [itemAgain, setAgainValue] = useState(null);
|
||||||
const [again, setAgain] = useState([
|
const [again, setAgain] = useState([
|
||||||
{
|
{
|
||||||
|
@ -90,7 +90,7 @@ export function AuthProvider({ children }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (resUser.status != 200) {
|
if (resUser.status != 200) {
|
||||||
throw Error("Username or password is incorrect!");
|
throw Error("user does not have user data");
|
||||||
}
|
}
|
||||||
|
|
||||||
const userData = await resUser.json();
|
const userData = await resUser.json();
|
||||||
@ -104,7 +104,7 @@ export function AuthProvider({ children }) {
|
|||||||
await storageUtil.setItem(TOKEN_KEY, loginData.data.jwt);
|
await storageUtil.setItem(TOKEN_KEY, loginData.data.jwt);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Failed to log in", err);
|
console.error("Failed to log in", err);
|
||||||
return { error: true, msg: err };
|
return { error: true, msg: err.res };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,12 +20,8 @@ function LoginPage() {
|
|||||||
}
|
}
|
||||||
}, [authState.authenticated]);
|
}, [authState.authenticated]);
|
||||||
|
|
||||||
async function login() {
|
function login() {
|
||||||
const res = await onLogin(email, pass);
|
onLogin(email, pass);
|
||||||
if (res !== undefined && res.error === true) {
|
|
||||||
alert(res.msg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user