chore: page and cycle refactor (#1159)
* fix: release note modal fix * chore: cycle and page endpoint refactor
This commit is contained in:
parent
26ba4d71c3
commit
c8caa925b1
16 changed files with 51 additions and 50 deletions
|
|
@ -21,9 +21,7 @@ export const AllCyclesList: React.FC<Props> = ({ viewType }) => {
|
|||
workspaceSlug && projectId ? CYCLES_LIST(projectId.toString()) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
cyclesService.getCyclesWithParams(workspaceSlug.toString(), projectId.toString(), {
|
||||
cycle_view: "all",
|
||||
})
|
||||
cyclesService.getCyclesWithParams(workspaceSlug.toString(), projectId.toString(), "all")
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,11 @@ export const CompletedCyclesList: React.FC<Props> = ({ viewType }) => {
|
|||
workspaceSlug && projectId ? COMPLETED_CYCLES_LIST(projectId.toString()) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
cyclesService.getCyclesWithParams(workspaceSlug.toString(), projectId.toString(), {
|
||||
cycle_view: "completed",
|
||||
})
|
||||
cyclesService.getCyclesWithParams(
|
||||
workspaceSlug.toString(),
|
||||
projectId.toString(),
|
||||
"completed"
|
||||
)
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,7 @@ export const DraftCyclesList: React.FC<Props> = ({ viewType }) => {
|
|||
workspaceSlug && projectId ? DRAFT_CYCLES_LIST(projectId.toString()) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
cyclesService.getCyclesWithParams(workspaceSlug.toString(), projectId.toString(), {
|
||||
cycle_view: "draft",
|
||||
})
|
||||
cyclesService.getCyclesWithParams(workspaceSlug.toString(), projectId.toString(), "draft")
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,11 @@ export const UpcomingCyclesList: React.FC<Props> = ({ viewType }) => {
|
|||
workspaceSlug && projectId ? UPCOMING_CYCLES_LIST(projectId.toString()) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
cyclesService.getCyclesWithParams(workspaceSlug.toString(), projectId.toString(), {
|
||||
cycle_view: "upcoming",
|
||||
})
|
||||
cyclesService.getCyclesWithParams(
|
||||
workspaceSlug.toString(),
|
||||
projectId.toString(),
|
||||
"upcoming"
|
||||
)
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,10 +38,7 @@ export const CycleSelect: React.FC<IssueCycleSelectProps> = ({
|
|||
const { data: cycles } = useSWR(
|
||||
workspaceSlug && projectId ? CYCLES_LIST(projectId) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
cycleServices.getCyclesWithParams(workspaceSlug as string, projectId as string, {
|
||||
cycle_view: "all",
|
||||
})
|
||||
? () => cycleServices.getCyclesWithParams(workspaceSlug as string, projectId as string, "all")
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,9 +60,11 @@ export const TransferIssuesModal: React.FC<Props> = ({ isOpen, handleClose }) =>
|
|||
workspaceSlug && projectId ? INCOMPLETE_CYCLES_LIST(projectId as string) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
cyclesService.getCyclesWithParams(workspaceSlug as string, projectId as string, {
|
||||
cycle_view: "incomplete",
|
||||
})
|
||||
cyclesService.getCyclesWithParams(
|
||||
workspaceSlug as string,
|
||||
projectId as string,
|
||||
"incomplete"
|
||||
)
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -36,9 +36,11 @@ export const SidebarCycleSelect: React.FC<Props> = ({
|
|||
workspaceSlug && projectId ? INCOMPLETE_CYCLES_LIST(projectId as string) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
cyclesService.getCyclesWithParams(workspaceSlug as string, projectId as string, {
|
||||
cycle_view: "incomplete",
|
||||
})
|
||||
cyclesService.getCyclesWithParams(
|
||||
workspaceSlug as string,
|
||||
projectId as string,
|
||||
"incomplete"
|
||||
)
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,10 +18,7 @@ export const AllPagesList: React.FC<TPagesListProps> = ({ viewType }) => {
|
|||
const { data: pages } = useSWR(
|
||||
workspaceSlug && projectId ? ALL_PAGES_LIST(projectId as string) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
pagesService.getPagesWithParams(workspaceSlug as string, projectId as string, {
|
||||
page_view: "all",
|
||||
})
|
||||
? () => pagesService.getPagesWithParams(workspaceSlug as string, projectId as string, "all")
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@ export const FavoritePagesList: React.FC<TPagesListProps> = ({ viewType }) => {
|
|||
workspaceSlug && projectId ? FAVORITE_PAGES_LIST(projectId as string) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
pagesService.getPagesWithParams(workspaceSlug as string, projectId as string, {
|
||||
page_view: "favorite",
|
||||
})
|
||||
pagesService.getPagesWithParams(workspaceSlug as string, projectId as string, "favorite")
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,11 @@ export const MyPagesList: React.FC<TPagesListProps> = ({ viewType }) => {
|
|||
workspaceSlug && projectId ? MY_PAGES_LIST(projectId as string) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
pagesService.getPagesWithParams(workspaceSlug as string, projectId as string, {
|
||||
page_view: "created_by_me",
|
||||
})
|
||||
pagesService.getPagesWithParams(
|
||||
workspaceSlug as string,
|
||||
projectId as string,
|
||||
"created_by_me"
|
||||
)
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,11 @@ export const OtherPagesList: React.FC<TPagesListProps> = ({ viewType }) => {
|
|||
workspaceSlug && projectId ? OTHER_PAGES_LIST(projectId as string) : null,
|
||||
workspaceSlug && projectId
|
||||
? () =>
|
||||
pagesService.getPagesWithParams(workspaceSlug as string, projectId as string, {
|
||||
page_view: "created_by_other",
|
||||
})
|
||||
pagesService.getPagesWithParams(
|
||||
workspaceSlug as string,
|
||||
projectId as string,
|
||||
"created_by_other"
|
||||
)
|
||||
: null
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue