-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat: Create an Organisation on Gogs (Fly.io) via REST API #8
Comments
Sadly, there doesn't appear to be an org creation endpoint ... |
We are going to get around this by simply doing |
Parking this code here for now. Sadly it doesn't work ... @doc """
`patch/1` accepts `url`;
the `url` of the API endpoint to create the `org`.
"""
@spec patch(String.t(), map) :: {:ok, map} | {:error, any}
def patch(url, params) do
body = Jason.encode!(params)
headers = [
{"Accept", "application/json"},
{"Authorization", "token #{@access_token}"},
{"Content-Type", "application/json"}
]
inject_poison().patch(url, body, headers)
|> parse_body_response()
end
@doc """
`org_create/1` accepts 1 argument: `org_name` to be crated.
"""
def org_create(org_name) do
url = @api_base_url <> "orgs/#{org_name}?token=#{@access_token}"
# IO.inspect(url, label: "remote_repo_delete url")
params = %{
full_name: org_name,
description: org_name,
}
patch(url, params)
end |
Dang ... 🤦♂️ For reference, the Were last updated Dec 17, 2018 ... I didn't see this as a "Red flag" at the time because I didn't think we would need all the Org-related APIs ... |
GOTO: dwyl/gitea#7 |
My reading of the
Org
API: https://github.com/gogs/docs-api/tree/master/Organizationsis that there is no way to create an
Org
, e.g:or
So going to try and use the "Edit" endpoint:
https://github.com/gogs/docs-api/tree/master/Organizations#edit-an-organization
If that fails, I will be opening an issue on: https://github.com/gogs/docs-api/issues ⏳
And I might end up writing some
Go
code today. 💭Wish me luck! 🤞
The text was updated successfully, but these errors were encountered: