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

allow cancel/edit a subcourse always when user is an admin #967

Closed
wants to merge 2 commits into from

Conversation

paul-jaworski
Copy link
Contributor

No description provided.

@paul-jaworski paul-jaworski self-assigned this Jan 26, 2024
@realmayus realmayus temporarily deployed to backend-feat-942-fgvuujog9hhxc January 26, 2024 20:08 Inactive
if (await subcourseOver(subcourse)) {
return { allowed: false, reason: 'subcourse-ended' };
}

return { allowed: true };
}

export async function cancelSubcourse(user: User, subcourse: Subcourse) {
const can = await canCancel(subcourse);
export async function cancelSubcourse(user: User, subcourse: Subcourse, context: GraphQLContext) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please only pass an isAdmin boolean to this function, as the functions in common/ are supposed to be as general as possible. The graphql context should be contained in the graphql mutations/resolvers.

@realmayus realmayus temporarily deployed to backend-feat-942-fgvuujog9hhxc January 27, 2024 18:02 Inactive
@realmayus realmayus closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants