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

API: Add pagination metadata to Environment module #337

Closed
rajdip-b opened this issue Jul 10, 2024 · 4 comments · Fixed by #382
Closed

API: Add pagination metadata to Environment module #337

rajdip-b opened this issue Jul 10, 2024 · 4 comments · Fixed by #382
Assignees
Labels
difficulty: 2 foss hack Clustering all the curated issues for Foss Hack 2024 good first issue Good for newcomers help wanted Extra attention is needed priority: high scope: api Everything related to the API type: enhancement New feature or request

Comments

@rajdip-b
Copy link
Member

Description

Refer to #336

Scope of change

  • async getEnvironmentsOfProject(
    user: User,
    projectId: Project['id'],
    page: number,
    limit: number,
    sort: string,
    order: string,
    search: string
    ) {
    await this.authorityCheckerService.checkAuthorityOverProject({
    userId: user.id,
    entity: { id: projectId },
    authority: Authority.READ_ENVIRONMENT,
    prisma: this.prisma
    })
    // Get the environments
    return await this.prisma.environment.findMany({
    where: {
    projectId,
    name: {
    contains: search
    }
    },
    select: {
    id: true,
    name: true,
    description: true,
    createdAt: true,
    updatedAt: true,
    lastUpdatedBy: {
    select: {
    id: true,
    email: true,
    profilePictureUrl: true,
    name: true
    }
    }
    },
    skip: page * limit,
    take: limit,
    orderBy: {
    [sort]: order
    }
    })
    }
@rajdip-b rajdip-b added type: enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed scope: api Everything related to the API priority: high foss hack Clustering all the curated issues for Foss Hack 2024 difficulty: 2 labels Jul 10, 2024
@rajdip-b rajdip-b changed the title API: Apply pagination to Environment module API: Add pagination metadata to Environment module Jul 10, 2024
@ATHARVA-JADHAV
Copy link

I'd like to work on this issue. This will be my first time contributing code to an open-source project, Could you please offer some guidance or share any helpful information to get me started?

@rajdip-b
Copy link
Member Author

Hey @ATHARVA-JADHAV! The parent issue is already assigned to someone! Could you please look around for some other issues? I can assign them to you.

@muntaxir4
Copy link
Contributor

/attempt Already working on its parent issue #336

Copy link

Assigned the issue to @muntaxir4!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 2 foss hack Clustering all the curated issues for Foss Hack 2024 good first issue Good for newcomers help wanted Extra attention is needed priority: high scope: api Everything related to the API type: enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants