Added Editing of Questions
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
import Button from "./Button.svelte";
|
||||
import Modal from "./Modal.svelte";
|
||||
import Textfield from "./Textfield.svelte";
|
||||
import { fetchCategory } from "../routes/editor/fetchers";
|
||||
|
||||
interface Props {
|
||||
wall: Wall | FullWall | undefined;
|
||||
@@ -40,15 +41,7 @@
|
||||
if (wall && isWall(wall)) {
|
||||
let cats: Promise<Category>[] = [];
|
||||
for (const catId of wall.categories) {
|
||||
cats.push(
|
||||
axios
|
||||
.get(url(`/category?id=${catId}`), { withCredentials: true })
|
||||
.then((response) => {
|
||||
if (response.status === 200) {
|
||||
return response.data;
|
||||
} else throw "Failed to fetch: " + response.status;
|
||||
})
|
||||
);
|
||||
cats.push(fetchCategory(catId));
|
||||
}
|
||||
return Promise.all(cats).then((cats) => {
|
||||
categories = cats;
|
||||
|
||||
Reference in New Issue
Block a user