Merge branch 'dev' of https://github.com/linkwarden/linkwarden into dev
This commit is contained in:
commit
c103b66694
|
@ -63,7 +63,8 @@ async function processBookmarks(
|
||||||
) as Element;
|
) as Element;
|
||||||
|
|
||||||
if (collectionName) {
|
if (collectionName) {
|
||||||
const collectionNameContent = (collectionName.children[0] as TextNode)?.content;
|
const collectionNameContent = (collectionName.children[0] as TextNode)
|
||||||
|
?.content;
|
||||||
if (collectionNameContent) {
|
if (collectionNameContent) {
|
||||||
collectionId = await createCollection(
|
collectionId = await createCollection(
|
||||||
userId,
|
userId,
|
||||||
|
@ -274,4 +275,3 @@ function processNodes(nodes: Node[]) {
|
||||||
nodes.forEach(findAndProcessDL);
|
nodes.forEach(findAndProcessDL);
|
||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@ const getPublicCollectionData = async (
|
||||||
) => {
|
) => {
|
||||||
const res = await fetch("/api/v1/public/collections/" + collectionId);
|
const res = await fetch("/api/v1/public/collections/" + collectionId);
|
||||||
|
|
||||||
|
if (res.status === 400)
|
||||||
|
return { response: "Collection not found.", status: 400 };
|
||||||
|
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
|
|
||||||
setData(data.response);
|
setData(data.response);
|
||||||
|
|
|
@ -71,7 +71,13 @@ export default function PublicCollections() {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (router.query.id) {
|
if (router.query.id) {
|
||||||
getPublicCollectionData(Number(router.query.id), setCollection);
|
getPublicCollectionData(Number(router.query.id), setCollection).then(
|
||||||
|
(res) => {
|
||||||
|
if (res.status === 400) {
|
||||||
|
router.push("/dashboard");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}, [collections]);
|
}, [collections]);
|
||||||
|
|
||||||
|
|
Ŝarĝante…
Reference in New Issue