Skip to content
Snippets Groups Projects
Commit 5efdd38f authored by Anders Høvik's avatar Anders Høvik
Browse files

Merge branch 'main' into feature/profile-layout

parents 77182fd8 e824eb41
No related branches found
No related tags found
1 merge request!12Feature/profile layout
Pipeline #274178 failed
......@@ -21,7 +21,7 @@ export type OpenAPIConfig = {
export const OpenAPI: OpenAPIConfig = {
BASE: 'http://localhost:8080',
VERSION: '0',
VERSION: '3.0',
WITH_CREDENTIALS: false,
CREDENTIALS: 'include',
TOKEN: undefined,
......
......@@ -6,3 +6,10 @@ export { ApiError } from './core/ApiError';
export { CancelablePromise, CancelError } from './core/CancelablePromise';
export { OpenAPI } from './core/OpenAPI';
export type { OpenAPIConfig } from './core/OpenAPI';
export type { AuthenticationResponse } from './models/AuthenticationResponse';
export type { ExceptionResponse } from './models/ExceptionResponse';
export type { LoginRequest } from './models/LoginRequest';
export type { SignUpRequest } from './models/SignUpRequest';
export { AuthenticationService } from './services/AuthenticationService';
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type AuthenticationResponse = {
firstName?: string;
lastName?: string;
role?: string;
token?: string;
};
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ExceptionResponse = {
status?: number;
message?: string;
};
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type LoginRequest = {
email?: string;
password?: string;
};
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type SignUpRequest = {
firstName?: string;
lastName?: string;
email?: string;
password?: string;
changeWilling?: string;
experience?: string;
challenges?: Array<string>;
};
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AuthenticationResponse } from '../models/AuthenticationResponse';
import type { LoginRequest } from '../models/LoginRequest';
import type { SignUpRequest } from '../models/SignUpRequest';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class AuthenticationService {
/**
* User Signup
* Sign up a new user
* @returns AuthenticationResponse Successfully signed up
* @throws ApiError
*/
public static signup({
requestBody,
}: {
requestBody: SignUpRequest,
}): CancelablePromise<AuthenticationResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/auth/signup',
body: requestBody,
mediaType: 'application/json',
errors: {
409: `Email already exists`,
},
});
}
/**
* User Login
* Log in with an existing user
* @returns AuthenticationResponse Successfully logged in
* @throws ApiError
*/
public static login({
requestBody,
}: {
requestBody: LoginRequest,
}): CancelablePromise<AuthenticationResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/auth/login',
body: requestBody,
mediaType: 'application/json',
errors: {
401: `Invalid credentials`,
404: `User not found`,
},
});
}
}
<template>
<button type="button" class="btn btn-success" id="buttonStyle">{{ buttonText }}</button>
<button type="button" class="btn btn-primary" id="buttonStyle">{{ buttonText }}</button>
</template>
<script>
......
......@@ -18,16 +18,16 @@ const routes = [
component: () => import('../views/HomeView.vue'),
meta: { requiresAuth: true },
},
{
path: '/:pathMatch(.*)*',
name: 'not-found',
component: () => import('@/views/NotFoundView.vue'),
},
{
path: '/news',
name: 'news',
component: () => import('@/views/NewsView.vue'),
},
{
path: 'leaderboard',
name: 'leaderboard',
component: () => import('@/views/LeaderboardView.vue'),
},
{
path: 'test',
name: 'test',
......@@ -38,6 +38,16 @@ const routes = [
name: 'roadmap',
component: () => import('@/views/SavingGoalView/RoadmapView.vue'),
},
{
path: 'feedback',
name: 'feedback',
component: () => import('@/views/FeedbackView.vue'),
},
{
path: 'shop',
name: 'shop',
component: () => import('@/views/ShopView.vue'),
},
{
path: 'admin',
name: 'admin',
......@@ -49,6 +59,11 @@ const routes = [
name: 'unauthorized',
component: () => import('@/views/UnauthorizedView.vue'),
},
{
path: '/:pathMatch(.*)*',
name: 'not-found',
component: () => import('@/views/NotFoundView.vue'),
},
]
},
{
......
<template>
<main>
<div class="wrapper">
<div id="formFrame">
<h1>Feedback</h1>
<form @submit.prevent="submitForm">
<BaseInput v-model="email" label="Email" type="email" placeholder="Enter your email" inputId="email" required />
<br>
<label for="feedback">Your feedback:</label>
<textarea v-model="message" placeholder="Write here" rows="5" name="comment[text]" id="comment_text" cols="33"
required></textarea>
<Button1 button-text="Send" @click="submitForm">Submit</Button1>
<p v-if="submissionStatus">{{ submissionStatus }}</p>
</form>
</div>
</div>
</main>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import BaseInput from '@/components/InputFields/BaseInput.vue';
import Button1 from '@/components/Buttons/Button1.vue';
const email = ref("");
const message = ref("");
const submissionStatus = ref("");
const submitForm = async () => {
};
</script>
<style scoped>
main {
display: flex;
flex-direction: column;
align-items: center;
font-family: 'Poppins', sans-serif;
}
.wrapper {
width: 60%;
height: 100%;
margin: 30px;
margin-bottom: 4rem;
display: flex;
justify-content: center;
align-items: center;
}
#formFrame {
width: 400px;
padding: 40px;
border-radius: 50px;
color: #101010;
}
textarea {
padding: 10px;
max-width: 100%;
line-height: 1.5;
border-radius: 5px;
border: 1px solid #ccc;
box-shadow: 1px 1px 1px #999;
}
textarea {
width: 500px;
height: 100px;
background: none repeat scroll 0 0 rgba(255, 255, 255, 0.151);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) inset;
color: #555555;
font-size: 0.9em;
line-height: 1.4em;
padding: 5px 8px;
transition: background-color 0.2s ease 0s;
}
textarea:focus {
background: none repeat scroll 0 0 #FFFFFF;
outline-width: 0;
}
</style>
\ No newline at end of file
<template>
Hallo
</template>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment