Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

feat: migrate POST /api/workspaces/:workspace_id/users to API v1 #156

Conversation

jfcalvo
Copy link
Member

@jfcalvo jfcalvo commented May 8, 2024

Description

This PR add a new endpoint POST /api/v1/workspaces/:workspace_id/users to create a new user for a workspace.

Changes introduced in this new endpoint compared to the old one:

  • Now we must provide the user_id in the body of the POST request instead of adding it in the URL.
  • I have changed the create_workspace_user context function so we need an additional change in argilla repo. The PR with the changes on argilla is here: feat: changes related with migrating endpoints from API v0 to API v1 argilla#4807
  • As done with previous PRs the returned user doesn't has full_name or workspaces.

Closes #155

Type of change

(Please delete options that are not relevant. Remember to title the PR according to the type of change)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (change restructuring the codebase without changing functionality)
  • Improvement (change adding some improvement to an existing functionality)
  • Documentation update

How Has This Been Tested

  • Adding new tests for the endpoint.

Checklist

  • I added relevant documentation
  • follows the style guidelines of this project
  • I did a self-review of my code
  • I made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I filled out the contributor form (see text above)
  • I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

@jfcalvo jfcalvo requested a review from frascuchon May 8, 2024 12:12
@jfcalvo jfcalvo changed the title feat: migrate creation of workspace users to API v1 feat: migrate POST /api/workspaces/:workspace_id/users to API v1 May 8, 2024
@@ -21,6 +21,12 @@ class NotFoundError(Exception):
pass


class NotUniqueError(Exception):
Copy link
Member

Choose a reason for hiding this comment

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

+1

Base automatically changed from feat/migrate-list-workspace-users-to-api-v1 to feat/move-api-v0-functionality-to-v1 May 13, 2024 10:25
@jfcalvo jfcalvo merged commit a21e75d into feat/move-api-v0-functionality-to-v1 May 13, 2024
10 checks passed
@jfcalvo jfcalvo deleted the feat/migrate-create-workspace-users-to-api-v1 branch May 13, 2024 10:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Migrate POST /api/workspaces/:workspace_id/users/:user_id endpoint
2 participants