Skip to content

Commit 7994408

Browse files
authored
Add id to getEntry return as fallback
This modification allows us to later filterEntry if the entry is not found. The usecase for it is: 1. while using it with soft-delete plugin, the soft-delete first update and then delete it. 2. the way it is right now, filterEntry receives an empty object, so we can't trace what is this entry. 3. If we add the `id`, I believe there is no implication, and we can use it to build our logic at filterEntry, knowing at least the id. This is our usecase, but I believe having the id can be useful in other scenarios that uses filterEntry, because at least you receive a relevant information at the filterEntry function.
1 parent d0f031d commit 7994408

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/services/content-types/content-types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ module.exports = ({ strapi }) => ({
148148
strapi.log.error(`Could not find entry with id ${id} in ${contentType}`)
149149
}
150150

151-
return entry || {}
151+
return entry || { id }
152152
},
153153

154154
/**

0 commit comments

Comments
 (0)