Skip to content
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

Rename catalog to catalogue #43

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions catalogues.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Catalogues interface {
GetCatalogue(ctx context.Context, id int64, opts ...Option) (*GetCatalogueOutput, error)
ListCatalogues(ctx context.Context, options *ListCataloguesInput, opts ...Option) (*ListCataloguesOutput, error)
UpdateCatalogue(ctx context.Context, id int64, input *UpdateCatalogueInput, opts ...Option) (*UpdateCatalogueOutput, error)
DeleteCatalogue(ctx context.Context, id int64, opts ...Option) (*CatalogueOutput, error)
DeleteCatalogue(ctx context.Context, id int64, opts ...Option) (*CatalogueOutput, error)
}

type catalogues struct {
Expand Down Expand Up @@ -114,7 +114,6 @@ func (p catalogues) DeleteCatalogue(ctx context.Context, id int64, opts ...Optio
return &CatalogueOutput{}, nil
}


type CatalogueInput struct {
ID *int64 `json:"ID,omitempty"`
Name string `json:"Name,omitempty"`
Expand Down
4 changes: 1 addition & 3 deletions custom-time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
)

func TestCustomTime_UnmarshalJSON(t *testing.T) {
var (
t0, _ = time.Parse("2006-01-02 15:04", "2020-01-01 00:00")
)
t0, _ := time.Parse("2006-01-02 15:04", "2020-01-01 00:00")
tests := []struct {
name string
Time time.Time
Expand Down
23 changes: 18 additions & 5 deletions pages.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Pages interface {
GetPage(ctx context.Context, id int64, opts ...Option) (*GetPageOutput, error)
ListPages(ctx context.Context, options *ListPagesInput, opts ...Option) (*ListPagesOutput, error)
UpdatePage(ctx context.Context, id int64, input *UpdatePageInput, opts ...Option) (*UpdatePageOutput, error)
DeletePage(ctx context.Context, id int64, opts ...Option) (*PageOutput, error)
}

type pages struct {
Expand Down Expand Up @@ -104,10 +105,22 @@ func (p pages) UpdatePage(ctx context.Context, id int64, input *UpdatePageInput,
}, nil
}

func (p pages) DeletePage(ctx context.Context, id int64, opts ...Option) (*PageOutput, error) {
_, err := p.client.doDelete(ctx, fmt.Sprintf(pathPage, id), nil, nil)
if err != nil {
return nil, err
}

return &PageOutput{}, nil
}

type PageInput struct {
ID *int64 `json:",omitempty"`
Type string
Name string
AllowFormSubmission bool `json:"AllowFormSubmission"`
PageTypeID int64 `json:"PageTypeID"`
Path string `json:"Path"`
Status string `json:"Status"`
Template string `json:"Template"`
Title string `json:"Title"`
}

type UpdatePageInput = PageInput
Expand All @@ -122,8 +135,8 @@ type ListPagesOutput struct {

type Page struct {
AllowFormSubmission bool `json:"AllowFormSubmission"`
ID int `json:"ID"`
PageTypeID int `json:"PageTypeID"`
ID int64 `json:"ID"`
PageTypeID int64 `json:"PageTypeID"`
Path string `json:"Path"`
Status string `json:"Status"`
Template string `json:"Template"`
Expand Down
Loading