diff --git a/src/app/colecao/[id]/components/collectionItems.js b/src/app/colecao/[id]/components/collectionItems.js index 4ab3b06aa28efe212b11f2b67e8a274596153052..567a502493bc13cfd723c3ec099ad651ef3046aa 100644 --- a/src/app/colecao/[id]/components/collectionItems.js +++ b/src/app/colecao/[id]/components/collectionItems.js @@ -8,7 +8,7 @@ export default function CollectionItems({ collection }) { <div className="flex flex-col bg-white p-4 rounded-lg"> <div className="text-main-text font-bold text-xl mb-3">Recursos na coleção</div> <div className="flex flex-col gap-3"> - {collection.collection_items.map((item, index) => { + {collection.collection_items.sort((a,b) => a.position - b.position).map((item, index) => { return ( <Cards collectionSource={collection["id"]} diff --git a/src/app/colecao/[id]/page.js b/src/app/colecao/[id]/page.js index e20042f1e416d3b7119fa35bd75ed6bd67394b56..b31d7bf87fe0af2c49c4209437839a613b07b403 100644 --- a/src/app/colecao/[id]/page.js +++ b/src/app/colecao/[id]/page.js @@ -39,9 +39,7 @@ export default function Colecao({ params }) { }; } - const response = await mecredApi.get(`collections/${params.id}`, { - headers: headers, - }); + const response = await mecredApi.get(`collections/${params.id}`); setCollection(response.data); } catch (error) {