Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: public switch #356

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web-app/packages/lib/src/modules/project/projectApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export const ProjectApi = {
data: UpdatePublicFlagParams,
withRetry?: boolean
): Promise<AxiosResponse<ProjectAccess>> {
return ProjectModule.httpService.patch(`/app/project/${id}/access`, data, {
return ProjectModule.httpService.patch(`/app/project/${id}/public`, data, {
...(withRetry ? getDefaultRetryOptions() : {})
})
},
Expand Down
7 changes: 2 additions & 5 deletions web-app/packages/lib/src/modules/project/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -884,11 +884,8 @@ export const useProjectStore = defineStore('projectModule', {
const notificationStore = useNotificationStore()
this.accessLoading = true
try {
const response = await ProjectApi.updatePublicFlag(
payload.projectId,
payload.data
)
this.project.access = response.data
await ProjectApi.updatePublicFlag(payload.projectId, payload.data)
this.project.access.public = !this.project.access?.public
} catch {
notificationStore.error({
text: `Failed to update public flag`
Expand Down
Loading