Skip to content

Commit

Permalink
Merge pull request #50 from badgateway/sk/48/make-hal-form-on-project…
Browse files Browse the repository at this point in the history
…-item

Make a HAL Form on the Project Item #48
  • Loading branch information
syedfkabir authored Oct 28, 2022
2 parents 3a1c619 + 95f7d8b commit d6c80e0
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions src/project/formats/hal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,46 @@ export function item(project: Project) {
},
collection: {
title: 'List of projects',
href: '/project'
href: '/project',
},
client: {
title: project.client.name,
href: project.client.href,
},
'entry-collection': {
title: 'List of time entries',
href: project.href + '/entry'
}
href: project.href + '/entry',
},
},
_templates: {
add: {
title: 'Add a Person to a Project',
method: 'POST',
contentType: 'application/json',
target: `${project.href}/person`,
properties: [
{
name: 'Role',
prompt: 'Role',
required: true,
options: {
inline: ['member', 'manager', 'owner'],
},
},
{
name: 'name',
prompt: 'Name',
required: true,
placeHolder: 'John Doe',
},
{
name: 'href',
prompt: 'Href',
required: true,
placeHolder: 'mailto:[email protected]',
},
],
},
},
name: project.name,
createdAt: project.createdAt.toISOString(),
Expand Down

0 comments on commit d6c80e0

Please sign in to comment.