Function comments
This commit is contained in:
parent
23699abd68
commit
58e57978fd
4 changed files with 13 additions and 0 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
import {toast} from "@zerodevx/svelte-toast";
|
import {toast} from "@zerodevx/svelte-toast";
|
||||||
import {capitalizeFirstLetter} from "./PomeloUtils";
|
import {capitalizeFirstLetter} from "./PomeloUtils";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an error message toast with red background.
|
||||||
|
* @param m
|
||||||
|
*/
|
||||||
export const createErrorToast = (m: string) => {
|
export const createErrorToast = (m: string) => {
|
||||||
toast.push("Error: " + capitalizeFirstLetter(m), {
|
toast.push("Error: " + capitalizeFirstLetter(m), {
|
||||||
theme: {
|
theme: {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
/**
|
||||||
|
* User.
|
||||||
|
*/
|
||||||
export class User {
|
export class User {
|
||||||
id: number;
|
id: number;
|
||||||
email: string;
|
email: string;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@
|
||||||
let rememberMe: boolean = true;
|
let rememberMe: boolean = true;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the button click.
|
||||||
|
*/
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
const endpoint = "http://localhost:1337/api/auth/local";
|
const endpoint = "http://localhost:1337/api/auth/local";
|
||||||
const payload = {
|
const payload = {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
import type {User} from "../../../models/user";
|
import type {User} from "../../../models/user";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User Login Auth.
|
||||||
|
*/
|
||||||
export interface Authentication {
|
export interface Authentication {
|
||||||
jwt: string;
|
jwt: string;
|
||||||
user: User;
|
user: User;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue