Skip to content

Tenant create fails if tenant already exists #80

@Akkuma

Description

@Akkuma
  • 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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions