forked from github/plane
fix: my profile activity endpoint (#1983)
* fix: my profile activity endpoint * chore: update service name
This commit is contained in:
parent
6e7701d854
commit
485e56bcdf
@ -25,18 +25,10 @@ const ProfileActivity = () => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug } = router.query;
|
const { workspaceSlug } = router.query;
|
||||||
|
|
||||||
const { data: userActivity } = useSWR(USER_ACTIVITY, () => userService.getUserActivity());
|
const { data: userActivity } = useSWR(
|
||||||
|
workspaceSlug ? USER_ACTIVITY : null,
|
||||||
if (!userActivity) {
|
workspaceSlug ? () => userService.getUserActivity(workspaceSlug.toString()) : null
|
||||||
return (
|
);
|
||||||
<Loader className="space-y-5">
|
|
||||||
<Loader.Item height="40px" />
|
|
||||||
<Loader.Item height="40px" />
|
|
||||||
<Loader.Item height="40px" />
|
|
||||||
<Loader.Item height="40px" />
|
|
||||||
</Loader>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WorkspaceAuthorizationLayout
|
<WorkspaceAuthorizationLayout
|
||||||
@ -56,7 +48,7 @@ const ProfileActivity = () => {
|
|||||||
</div>
|
</div>
|
||||||
<SettingsNavbar profilePage />
|
<SettingsNavbar profilePage />
|
||||||
</div>
|
</div>
|
||||||
{userActivity && userActivity.results.length > 0 && (
|
{userActivity ? (
|
||||||
<div>
|
<div>
|
||||||
<ul role="list" className="-mb-4">
|
<ul role="list" className="-mb-4">
|
||||||
{userActivity.results.map((activityItem: any, activityIdx: number) => {
|
{userActivity.results.map((activityItem: any, activityIdx: number) => {
|
||||||
@ -226,6 +218,13 @@ const ProfileActivity = () => {
|
|||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
<Loader className="space-y-5">
|
||||||
|
<Loader.Item height="40px" />
|
||||||
|
<Loader.Item height="40px" />
|
||||||
|
<Loader.Item height="40px" />
|
||||||
|
<Loader.Item height="40px" />
|
||||||
|
</Loader>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</WorkspaceAuthorizationLayout>
|
</WorkspaceAuthorizationLayout>
|
||||||
|
@ -101,8 +101,8 @@ class UserService extends APIService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserActivity(): Promise<IUserActivityResponse> {
|
async getUserWorkspaceActivity(workspaceSlug: string): Promise<IUserActivityResponse> {
|
||||||
return this.get("/api/users/activities/")
|
return this.get(`/api/users/workspaces/${workspaceSlug}/activities/`)
|
||||||
.then((response) => response?.data)
|
.then((response) => response?.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
throw error?.response?.data;
|
throw error?.response?.data;
|
||||||
|
Loading…
Reference in New Issue
Block a user