Fix missing ID generation for new news items and add IDs to existing entries
This commit is contained in:
@@ -66,8 +66,8 @@ export async function saveNews(newsData) {
|
||||
} else {
|
||||
// Add new
|
||||
const newItem = {
|
||||
id: `n${Date.now()}`,
|
||||
...newsData,
|
||||
id: `n${Date.now()}`, // ID must come AFTER ...newsData to not be overwritten
|
||||
created: new Date().toISOString(),
|
||||
updated: new Date().toISOString()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user