Get projects marked for deletion
dsebastien opened this issue · comments
Sebastien Dubois commented
Description
I would like to be able to list projects that have been marked for deletion
Proposal
- Add the
marked_for_deletion_on
property toProjectSchema
- Add
markedForDeletion: boolean
toAllProjectsOptions
Checklist
- I have checked that this is not a duplicate issue.
- I have read the documentation.
Justin Dalrymple commented
Add markedForDeletion: boolean to AllProjectsOptions
Where do you see this in the docs for the all projects query? https://docs.gitlab.com/ee/api/projects.html#list-all-projects
Sebastien Dubois commented
Sorry for the confusion. You're right, it doesn't seem to be supported yet. I'll continue filtering on the client side for now:
import { ProjectSchema, Camelize, Gitlab } from 'https://esm.sh/@gitbeaker/rest?dts';
export async function getProjectsMarkedForDeletion(gitLabClient: InstanceType<typeof Gitlab>): Promise<(ProjectSchema | Camelize<ProjectSchema>)[]> {
// TODO refactor once improved upstream: https://github.com/jdalrymple/gitbeaker/issues/3443
const allProjects = await gitLabClient.Projects.all();
return (allProjects as any).filter((project: any) => project.markedForDeletionOn);
}
Sebastien Dubois commented
I have introduced issues to request this for groups and projects:
Justin Dalrymple commented
Ill update the type for now, but will keep this issue open for better tracking!