Added StrapiNoteRepository, .env not working, authHeader is mocked

This commit is contained in:
j-weissen 2022-10-04 10:14:28 +02:00
parent 5d86ca29fb
commit b1b081fe30
3 changed files with 101 additions and 10 deletions

View file

@ -1,24 +1,31 @@
<script lang="ts">
import type {Note} from "../../types";
import {beforeUpdate} from "svelte";
import {StrapiNoteRepository} from "../../models/StrapiNoteRepository";
import {NoteRepository} from "../../models/NoteRepository";
let noteRepo: NoteRepository;
let content: string;
let title: string;
beforeUpdate(async () => {
noteRepo = await StrapiNoteRepository.getInstance();
})
let notes: Note[] = JSON.parse(window.localStorage.getItem("notes"));
const clickedNoteId = window.localStorage.getItem("clickedNoteId");
const currNote = notes.find((note)=>{
return note.id === parseInt(clickedNoteId);
});
</script>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{"Pomelonote | Edit " + currNote.title}</title>
<title>{"Pomelonote | Edit "}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
</head>
<html lang="en">
<div class="offset-3 col-6">
{currNote.content}
<div class="row">
<div class="offset-md-4 col-md-4 shadow-textarea">
</div>
</div>
</html>
</html>