Skip to content

Commit

Permalink
Merge pull request #1249 from Chia-Network/org-import-delete-sub-adju…
Browse files Browse the repository at this point in the history
…stments

Org import delete sub adjustments
  • Loading branch information
wwills2 authored Dec 30, 2024
2 parents 5ff15a4 + 49c6d50 commit 063a69d
Show file tree
Hide file tree
Showing 16 changed files with 542 additions and 273 deletions.
36 changes: 16 additions & 20 deletions docs/cadt_rpc_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,14 @@ Response

PUT Options:

| Key | Type | Description |
|:------:|:-------:|:----------------------------------------------------:|
| orgUid | String | (Required) OrgUid of the home organization to import |
| Key | Type | Description |
|:------:|:-------:|:-------------------------------------------------------------------------------------:|
| orgUid | String | (Required) OrgUid of the home organization to import |
| isHome | Boolean | (Optional) Specify true if the specified orgUid should be imported as the home org |

### PUT Examples

#### Import a home organization that datalayer is subscribed to

- This is typically used when an organization currently using CADT is installing a new instance and wants to use the same
home organization and the current instance(s).
#### Import an organization and subscribe to its stores on datalayer

Request
```sh
Expand All @@ -232,24 +230,26 @@ curl --location -g --request PUT 'http://localhost:31310/v1/organizations/' \
Response
```json
{
"message":"Importing home organization."
"success": true,
"message": "Successfully imported organization. CADT will begin syncing data from datalayer shortly"
}
```

DELETE Options: None

### DELETE Examples

#### Delete home organization
#### Delete organization

Request
```sh
curl --location --request DELETE 'http://localhost:31310/v1/organizations/'
curl --location --request DELETE \
'http://localhost:31310/v1/organizations/c9661d1ce77194c9e82311418aa4d370e25e10961d74d586636354746bc9ad65'
```
Response
```json
{
"message": "Your home organization was reset, please create a new one.",
"message": "Removed all organization records for organization ${orgUid} and unsubscribed from organization datalayer stores. cadt will not sync the organizations data from datalayer",
"success": true

}
Expand All @@ -259,15 +259,11 @@ Response
- POST `/organizations/remove-mirror` - given a store ID and coin ID removes the mirror for a given store
- POST `/organizations/sync` - runs the process to sync all subscribed organization metadata with datalayer
- POST `/organizations/create` - create an organization without an icon
- POST `/organizations/edit` - update an organization name and/or icon
- PUT `/organizations/import` - subscribe and import an organization via OrgUid
- DELETE `organizations/import` - delete an organization's record from the CADT instance DB
- PUT `organizations/subscribe` - subscribe to an organization datalayer singleton
- DELETE `organizations/unsubscribe` - unsubscribe from an organization datalayer singleton and keep CADT data
- PUT `organizations/resync` - resync an organization from datalayer
- POST `organizations/mirror` - add a mirror for a datalayer store via the store ID
- GET `organizations/metadata` - get an organizations metadata using the OrgUid
- GET `organizations/status` - the sync status of an organization via the OrgUid
- POST `/organizations/edit` - update an organization name and/or icon
- PUT `/organizations/resync` - resync an organization from datalayer
- POST `/organizations/mirror` - add a mirror for a datalayer store via the store ID
- GET `/organizations/metadata` - get an organizations metadata using the OrgUid
- GET `/organizations/status` - the sync status of an organization via the OrgUid

---

Expand Down
Loading

0 comments on commit 063a69d

Please sign in to comment.