Skip to content

Commit 8edcbca

Browse files
committed
fix: copilot reviews
1 parent 9f978cf commit 8edcbca

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This changelog follows the principles of [Keep a Changelog](https://keepachangel
88

99
### Added
1010

11-
- Guestbooke: Added `editGuestbook` use case.
11+
- Guestbooks: Added `editGuestbook` use case.
1212
- Guestbooks: Added `getGuestbookResponsesByGuestbookId` use case and repository support for retrieving paginated guestbook responses with total count as structured JSON.
1313
- Guestbooks: Added `downloadGuestbookResponsesByCollectionId` and `downloadGuestbookResponsesOfAGuestbook` use cases and repository support for exporting guestbook responses as raw CSV content.
1414
- Guestbooks: Added optional `includeStats` support to `getGuestbooksByCollectionId`, returning `usageCount` and `responseCount` when requested.

docs/useCases.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3304,7 +3304,14 @@ import { editGuestbook } from '@iqss/dataverse-client-javascript'
33043304

33053305
const guestbookId = 123
33063306
const guestbook: EditGuestbookDTO = {
3307-
name: 'new name'
3307+
name: 'new name',
3308+
enabled: true,
3309+
emailRequired: true,
3310+
nameRequired: true,
3311+
institutionRequired: false,
3312+
positionRequired: false,
3313+
createTime: '2026-06-12T00:00:00Z',
3314+
customQuestions: []
33083315
}
33093316

33103317
editGuestbook.execute(guestbookId, guestbook).then(() => {

src/guestbooks/domain/dtos/EditGuestbookDTO.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ export interface EditGuestbookDTO {
2525
institutionRequired: boolean
2626
positionRequired: boolean
2727
createTime: string
28-
customQuestions?: EditGuestbookCustomQuestionDTO[]
28+
customQuestions: EditGuestbookCustomQuestionDTO[]
2929
}

src/guestbooks/infra/repositories/GuestbooksRepository.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,10 @@ export class GuestbooksRepository extends ApiRepository implements IGuestbooksRe
2626
}
2727

2828
public async editGuestbook(guestbookId: number, guestbook: EditGuestbookDTO): Promise<void> {
29-
return this.doPut(
29+
await this.doPut(
3030
this.buildApiEndpoint(this.guestbooksResourceName, undefined, guestbookId),
3131
guestbook
3232
)
33-
.then(() => undefined)
34-
.catch((error) => {
35-
throw error
36-
})
3733
}
3834

3935
public async getGuestbook(guestbookId: number): Promise<Guestbook> {

0 commit comments

Comments
 (0)