Skip to content

Commit

Permalink
Issue Bug PS-2800: Fix search functionaity for content list
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshataKatwal16 committed Dec 10, 2024
1 parent 71106bf commit 48ba5e5
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/pages/workspace/content/allContents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ const AllContentsPage = () => {
const sort_by = {
lastUpdatedOn: order,
};
const offset = page * LIMIT;
const offset =debouncedSearchTerm!==""? 0: page * LIMIT;
console.log("seraching", debouncedSearchTerm)
const response = await getContent(
status,
query,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/workspace/content/discover-contents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ const ContentsPage = () => {
const sort_by = {
lastUpdatedOn: order,
};
const offset = page * LIMIT;
const offset =debouncedSearchTerm!==""? 0 : page * LIMIT;

const contentType="discover-contents"
let response;
if(state!=="All")
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/content/draft/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const DraftPage = () => {
try {
setLoading(true);
const query = debouncedSearchTerm || "";
const offset = page * LIMIT;
const offset =debouncedSearchTerm!==""? 0 : page * LIMIT;
const primaryCategory = filter.length ? filter : [];
const order = sortBy === "Created On" ? "asc" : "desc";
const sort_by = { lastUpdatedOn: order };
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/content/publish/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const PublishPage = () => {
try {
setLoading(true);
const query = debouncedSearchTerm || "";
const offset = page * LIMIT;
const offset =debouncedSearchTerm!==""? 0 : page * LIMIT;
const primaryCategory = filter.length ? filter : [];
const order = sortBy === "Created On" ? "asc" : "desc";
const sort_by = { lastUpdatedOn: order };
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/content/submitted/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const SubmittedForReviewPage = () => {
try {
setLoading(true);
const query = debouncedSearchTerm || "";
const offset = page * LIMIT;
const offset =debouncedSearchTerm!==""? 0 : page * LIMIT;
const primaryCategory = filter.length ? filter : [];
const order = sortBy === "Created On" ? "asc" : "desc";
const sort_by = { lastUpdatedOn: order };
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/content/up-review/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const UpForReviewPage = () => {
try {
setLoading(true);
const query = debouncedSearchTerm || "";
const offset = page * LIMIT;
const offset =debouncedSearchTerm!==""? 0 : page * LIMIT;
const primaryCategory = filter.length ? filter : [];
const order = sortBy === "Created On" ? "asc" : "desc";
const sort_by = { lastUpdatedOn: order };
Expand Down

0 comments on commit 48ba5e5

Please sign in to comment.