strapi-plugin-navigation icon indicating copy to clipboard operation
strapi-plugin-navigation copied to clipboard

Add createdAt and updatedAt fields to RFR response

Open adameli22 opened this issue 1 year ago • 2 comments

Im trying to generate a sitemap from the navigation plugin and the easiest way to do that is with the RFR response doe to it returning a single list with all the routes and their full path that is very easy to iterate through. The only issue is that unlike TREE and FLAT the RFR response does not return the updatedAt and createdAt field indicating when the Strapi content was created and last updated which is important for the sitemap. Is there an easy way to add these fields to the response since they are in both the TREE and the FLAT response?

RFR response image

FLAT response image

TREE response image

adameli22 avatar Mar 25 '24 11:03 adameli22

I have not tested this yet. But I checked out the function that renders the RFR page and I was wondering if instead of only returning the id and contentType it could be possible to spread out the related variable to return all the related information.

function now image

possible solution image

adameli22 avatar Mar 25 '24 11:03 adameli22

I tested the solution and I can confirm that by adding this change the response will add all the missing fields image

adameli22 avatar Mar 25 '24 15:03 adameli22