-
Notifications
You must be signed in to change notification settings - Fork 3
Added deleteServiceNextDescendentOnly function #20
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
base: trivir
Are you sure you want to change the base?
Conversation
94375fc
to
ebf6df8
Compare
2c88581
to
c061150
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you have any questions about the changes I requested. You will need to update the CLI PR as well with the renaming for the deleteServiceNextDescendants
function.
src/ops/ServiceOps.ts
Outdated
@@ -46,6 +47,10 @@ export type Service = { | |||
serviceId: string, | |||
globalConfig?: boolean | |||
): Promise<AmServiceSkeleton>; | |||
deleteServiceNextDescendentOnly( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this to be deleteServiceNextDecendants
, since it will be for deleting all next descendants of the service. Same for all other references to the function in this file
src/ops/ServiceOps.ts
Outdated
throw new FrodoError( | ||
`Error deleting ${ | ||
globalConfig ? 'global' : 'realm' | ||
} full service config ${serviceId}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error needs to be updated to indicate that there was a failure deleting the next descendants.
src/ops/ServiceOps.ts
Outdated
@@ -590,6 +604,46 @@ export async function deleteFullService({ | |||
} | |||
} | |||
|
|||
export async function deleteServiceNextDescentdentOnly({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this function is just copy/paste from the deleteFullService
function, you should refactor deleteFullService
to use this function for deleting the next descendants to reduce code redundancy.
src/ops/ServiceOps.ts
Outdated
@@ -46,6 +47,10 @@ export type Service = { | |||
serviceId: string, | |||
globalConfig?: boolean | |||
): Promise<AmServiceSkeleton>; | |||
deleteServiceNextDescendentOnly( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing documentation above this function
src/ops/ServiceOps.ts
Outdated
@@ -124,7 +129,16 @@ export default (state: State): Service => { | |||
): Promise<AmServiceSkeleton> { | |||
return deleteFullService({ serviceId, globalConfig, state }); | |||
}, | |||
|
|||
async deleteServiceNextDescendentOnly( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing documentation above this function
src/ops/ServiceOps.ts
Outdated
@@ -590,6 +604,46 @@ export async function deleteFullService({ | |||
} | |||
} | |||
|
|||
export async function deleteServiceNextDescentdentOnly({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing documentation above this function
No description provided.