mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-11 08:43:04 +00:00
refactor: create types instead of using models
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user