Cookie creation and error handling

This commit is contained in:
sprechtl 2022-09-25 22:08:38 +02:00
parent 985b94b109
commit 16af21123b
7 changed files with 149 additions and 25 deletions

View file

@ -0,0 +1,3 @@
export function capitalizeFirstLetter(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1);
}

View file

@ -0,0 +1,10 @@
import {toast} from "@zerodevx/svelte-toast";
import {capitalizeFirstLetter} from "./PomeloUtils";
export const createErrorToast = (m: string) => {
toast.push("Error: " + capitalizeFirstLetter(m), {
theme: {
'--toastBackground': 'red'
}
})
}

View file

@ -0,0 +1,22 @@
export class User {
id: number;
email: string;
username: string;
// Can be extended by these
// blocked: boolean;
// provider: string;
// confirmed: boolean;
// createdAt: Date;
// updatedAt: Date;
/**
* Creates the user.
* @param params Fetch data.
*/
constructor(params: any) {
this.id = params?.id;
this.email = params?.email;
this.username = params?.username;
}
}