Skip to content

Commit

Permalink
#164 [Backend Admin] CURD and Cache LRU Book,Author
Browse files Browse the repository at this point in the history
  • Loading branch information
fdhhhdjd committed Mar 9, 2023
1 parent 0a64f8e commit 321105c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,13 @@ const bookController = {
const result_book_detail = await book_model.getAllBook({ isdeleted: CONSTANTS.DELETED_DISABLE }, '*');
if (result_book_detail) {
// Add data cache lru argothim
globalCache.putCache(CONSTANTS.KEY_REDIS.ALL_BOOK, result_book_detail[0]);
globalCache.putCache(CONSTANTS.KEY_REDIS.ALL_BOOK, result_book_detail);

return res.status(200).json({
status: 200,
message: returnReasons('200'),
element: {
result: result_book_detail[0],
result: result_book_detail,
},
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ const bookController = {
const result_book = await book_model.getAllBook({ isdeleted: CONSTANTS.DELETED_DISABLE }, '*');
if (result_book) {
// Add data cache lru argothim
globalCache.putCache(CONSTANTS.KEY_REDIS.ALL_BOOK, result_book[0]);
globalCache.putCache(CONSTANTS.KEY_REDIS.ALL_BOOK, result_book);

return res.status(200).json({
status: 200,
message: returnReasons('200'),
element: {
result: result_book[0],
result: result_book,
},
});
}
Expand Down

0 comments on commit 321105c

Please sign in to comment.