Merge branch 'listing' into develop
# Conflicts: # backend/strapi/src/api/note/content-types/note/schema.json # frontend/svelte/package-lock.json # frontend/svelte/src/routes/editor/+page.svelte
This commit is contained in:
commit
b49a4c3ddf
9 changed files with 154 additions and 123 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import {parseCookies} from "nookies";
|
||||
|
||||
/**
|
||||
* Capitalises first letter of string.
|
||||
* @param str
|
||||
|
|
@ -18,4 +20,15 @@ export async function bearerFetch(endpoint: string, jwt: string, baseUrl: string
|
|||
Authorization: `Bearer ${jwt}`
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const getJwtCookie = () => {
|
||||
// @ts-ignore
|
||||
return parseCookies("/").jwt;
|
||||
};
|
||||
|
||||
/**
|
||||
* JWT Cookie
|
||||
*/
|
||||
export const jwt: string = getJwtCookie();
|
||||
11
frontend/svelte/src/models/types.ts
Normal file
11
frontend/svelte/src/models/types.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
export interface Note {
|
||||
id: number;
|
||||
attributes: Attribute;
|
||||
}
|
||||
|
||||
export interface Attribute {
|
||||
title: string;
|
||||
content: string;
|
||||
|
||||
lastViewed: Date;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue