User Project

'/users/{id}/projects'

GET

async find(
    @param.path.string('id') id: string,
    @param.query.object('filter') filter?: Filter<Project>,
  ): Promise<Project[]>

Auth: No

Get a user's projects.

POST

async create(
    @param.path.string('id') id: typeof User.prototype.id,
    @requestBody({
      content: {
        'application/json': {
          schema: getModelSchemaRef(Project, {
            title: 'NewProjectInUser',
            exclude: ['id'],
            optional: ['userId']
          }),
        },
      },
    }) project: Omit<Project, 'id'>,
  ): Promise<Project>

Auth: Yes RBAC: Admin, User (owner)

Create a project for a given user.

'/users/{id}/projects/{projectId}'

PATCH

async patch(
    @param.path.string('id') id: string,
    @param.path.number('projectId') projectId: typeof Project.prototype.id,
    @requestBody({
      content: {
        'application/json': {
          schema: getModelSchemaRef(Project, {partial: true}),
        },
      },
    })
    project: Partial<Project>,
  ): Promise<Count>

Auth: Yes RBAC: Admin, User (owner)

Edit a project for a given user.

DEL

async delete(
    @param.path.string('id') id: string,
    @param.path.number('projectId') projectId: typeof Project.prototype.id,
  ): Promise<Count>

Auth: Yes RBAC: Admin, User (owner)

Delete a project for a given user.

Last updated