Skip to content

Commit

Permalink
Merge pull request #217 from 5pm-HDH/fix/docs-for-note-request
Browse files Browse the repository at this point in the history
docs(note): fix docs #215
  • Loading branch information
DumbergerL authored Aug 1, 2024
2 parents df36d00 + 5b80ba7 commit f0f16f0
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Get GroupTypeRoles ([PR197](https://github.com/5pm-HDH/churchtools-api/pull/197))
- PHP coding standard ([PR193](https://github.com/5pm-HDH/churchtools-api/pull/193))
- Added new property 'postsEnabled' to the group type model ([PR204](https://github.com/5pm-HDH/churchtools-api/pull/204))
- Add Note for Group and SongArrangement ([PR216](https://github.com/5pm-HDH/churchtools-api/pull/216))
- Add Note for Group and SongArrangement ([PR216](https://github.com/5pm-HDH/churchtools-api/pull/216), [PR217](https://github.com/5pm-HDH/churchtools-api/pull/217))
- Login with Session Cookie ([PR207](https://github.com/5pm-HDH/churchtools-api/pull/207))

### Changed
Expand Down
46 changes: 42 additions & 4 deletions docs/out/GroupAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,16 +618,54 @@

Retrieve all notes:

(EXAMPLE CODE IS MISSING)
```php
use CTApi\Models\Common\Note\NoteRequest;

$notes = NoteRequest::forGroup(212)->get();
var_dump( $notes[0]->getText());
// Output: "Hello new comment!"

var_dump( $notes[0]->getDomainId());
// Output: "17"

var_dump( $notes[0]->getDomainType());
// Output: "group"

var_dump( $notes[0]->getId());
// Output: "212"


```

Create new note:

(EXAMPLE CODE IS MISSING)
```php
use CTApi\Models\Common\Note\NoteRequest;

$note = NoteRequest::forGroup(52)->create("Add new comment.");
var_dump( $note->getText());
// Output: "Add new comment."


```

Update note:

(EXAMPLE CODE IS MISSING)
```php
use CTApi\Models\Common\Note\NoteRequest;

$note = NoteRequest::forGroup(52)->update(25, "Updated comment.");
var_dump( $note->getText());
// Output: "Updated comment."


```

Delete note:

(EXAMPLE CODE IS MISSING)
```php
use CTApi\Models\Common\Note\NoteRequest;

NoteRequest::forGroup(52)->delete(25);

```
26 changes: 25 additions & 1 deletion docs/out/SongAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,31 @@

## Create Song-Arrangement Notes

(EXAMPLE CODE IS MISSING)
```php
use CTApi\Models\Common\Note\NoteRequest;

$notes = NoteRequest::forSongArrangement(21)->get();

var_dump( $notes[0]->getText());
// Output: "Hello new comment!"

var_dump( $notes[0]->getDomainId());
// Output: "17"

var_dump( $notes[0]->getDomainType());
// Output: "group"

var_dump( $notes[0]->getId());
// Output: "212"


$securityLevelId = 2;
$note = NoteRequest::forSongArrangement(21)->create("New comment", $securityLevelId);
$note = NoteRequest::forSongArrangement(21)->update(2, "New comment");

NoteRequest::forSongArrangement(21)->delete(2);

```

## Retrieve Data from CCLI

Expand Down
8 changes: 4 additions & 4 deletions docs/src/ressources/GroupAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@

Retrieve all notes:

{{ \CTApi\Test\Unit\Docs\NoteRequest.testRequestNotes }}
{{ \CTApi\Test\Unit\Docs\NoteRequestTest.testRequestNotes }}

Create new note:

{{ \CTApi\Test\Unit\Docs\NoteRequest.testCreateNote }}
{{ \CTApi\Test\Unit\Docs\NoteRequestTest.testCreateNote }}

Update note:

{{ \CTApi\Test\Unit\Docs\NoteRequest.testUpdateNote }}
{{ \CTApi\Test\Unit\Docs\NoteRequestTest.testUpdateNote }}

Delete note:

{{ \CTApi\Test\Unit\Docs\NoteRequest.testDeleteNote }}
{{ \CTApi\Test\Unit\Docs\NoteRequestTest.testDeleteNote }}
2 changes: 1 addition & 1 deletion docs/src/ressources/SongAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

## Create Song-Arrangement Notes

{{ \CTApi\Test\Unit\Docs\NoteRequest.testUpdateSongArrangementNotes }}
{{ \CTApi\Test\Unit\Docs\NoteRequestTest.testUpdateSongArrangementNotes }}

## Retrieve Data from CCLI

Expand Down

0 comments on commit f0f16f0

Please sign in to comment.