Skip to content

Commit

Permalink
#1258 addressing comments from team
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-flores committed Aug 20, 2024
1 parent 13cc2b2 commit 85a4076
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
11 changes: 9 additions & 2 deletions api-docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@
"Organization"
],
"summary": "Updates information about the organization specified by short name (accessible to Secretariat)",
"description": " <h2>Access Control</h2> <p>User must belong to an organization with the <b>Secretariat</b> role</p> <h2>Expected Behavior</h2> <p><b>Secretariat:</b> Updates any organization's information</p>",
"description": " <h2>Access Control</h2> <p>User must belong to an organization with the <b>Secretariat</b> role, or user must belong to the organization specified by short name</p> <h2>Expected Behavior</h2> <p><b>Secretariat:</b> Updates any organization's information</p> <p><b>Non-secretariat:</b> Updates 'last_active' timestamp to show that an org is still active</p>",
"operationId": "orgUpdateSingle",
"parameters": [
{
Expand Down Expand Up @@ -2142,7 +2142,14 @@
"content": {
"application/json": {
"schema": {
"$ref": "../schemas/org/update-org-response.json"
"oneOf": [
{
"$ref": "../schemas/org/update-org-response.json"
},
{
"$ref": "../schemas/org/am-i-alive-response.json"
}
]
}
}
}
Expand Down
13 changes: 9 additions & 4 deletions src/controller/org.controller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ router.put('/org/:shortname',
#swagger.summary = "Updates information about the organization specified by short name (accessible to Secretariat)"
#swagger.description = "
<h2>Access Control</h2>
<p>User must belong to an organization with the <b>Secretariat</b> role</p>
<p>User must belong to an organization with the <b>Secretariat</b> role, or user must belong to the organization specified by short name</p>
<h2>Expected Behavior</h2>
<p><b>CNA:</b> Updates 'last_active' timestamp to show that a CNA is still active</p>
<p><b>Secretariat:</b> Updates any organization's information</p>"
<p><b>Secretariat:</b> Updates any organization's information</p>
<p><b>Non-secretariat:</b> Updates 'last_active' timestamp to show that an org is still active</p>"
#swagger.parameters['shortname'] = { description: 'The shortname of the organization' }
#swagger.parameters['$ref'] = [
'#/components/parameters/id_quota',
Expand All @@ -264,7 +264,12 @@ router.put('/org/:shortname',
description: 'Returns information about the organization updated',
content: {
"application/json": {
schema: { $ref: '../schemas/org/update-org-response.json' }
schema: {
oneOf: [
{ $ref: '../schemas/org/update-org-response.json' },
{ $ref: '../schemas/org/am-i-alive-response.json' }
]
}
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/controller/org.controller/org.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,6 @@ async function updateOrg (req, res, next) {
})
}
}
if (shortName === orgMakingChanges) {
newOrg.last_active = Date.now()
}
})
}

Expand Down

0 comments on commit 85a4076

Please sign in to comment.