refactor: create types instead of using models

This commit is contained in:
Sonny
2024-05-26 23:43:48 +02:00
committed by Sonny
parent 55cd973b1a
commit e03952de1c
28 changed files with 582 additions and 176 deletions

View File

@@ -1,11 +1,11 @@
import type Collection from '#models/collection';
import { CollectionWithLinks } from '~/types/app';
export default function sortCcollectionsByNextId(
collections: Collection[]
): Collection[] {
const sortedCollections: Collection[] = [];
collections: CollectionWithLinks[]
): CollectionWithLinks[] {
const sortedCollections: CollectionWithLinks[] = [];
const visit = (collection: Collection) => {
const visit = (collection: CollectionWithLinks) => {
// Check if the collection has been visited
if (sortedCollections.includes(collection)) {
return;