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

Tenant create fails if tenant already exists #80

Open
Akkuma opened this issue Apr 29, 2024 · 0 comments
Open

Tenant create fails if tenant already exists #80

Akkuma opened this issue Apr 29, 2024 · 0 comments

Comments

@Akkuma
Copy link

Akkuma commented Apr 29, 2024

  • I'm submitting a ...
    [X] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    The docs say If the tenant is already created: will return 200 instead of 201, and will return the existing tenant object in the response body.. However this is throwing an error without a try/catch:

	try {
		tenant = await permit.api.tenants.get(tenantKey)
	} catch(e) {
		tenant = await permit.api.tenants.create({ key: tenantKey, name: sender.tenant.name })
	}
  • Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
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

No branches or pull requests

1 participant