Skip to content

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

Open
wants to merge 3 commits into
base: trivir
Choose a base branch
from

Conversation

skootrivir
Copy link

No description provided.

@skootrivir skootrivir changed the title Added deleteServiceNext Added deleteServiceNextDescendentOnly function Apr 30, 2025
@phalestrivir phalestrivir self-requested a review April 30, 2025 23:13
@phalestrivir phalestrivir force-pushed the trivir branch 3 times, most recently from 94375fc to ebf6df8 Compare May 12, 2025 19:05
Copy link
Collaborator

@phalestrivir phalestrivir left a 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.

@@ -46,6 +47,10 @@ export type Service = {
serviceId: string,
globalConfig?: boolean
): Promise<AmServiceSkeleton>;
deleteServiceNextDescendentOnly(
Copy link
Collaborator

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

throw new FrodoError(
`Error deleting ${
globalConfig ? 'global' : 'realm'
} full service config ${serviceId}`,
Copy link
Collaborator

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.

@@ -590,6 +604,46 @@ export async function deleteFullService({
}
}

export async function deleteServiceNextDescentdentOnly({
Copy link
Collaborator

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.

@@ -46,6 +47,10 @@ export type Service = {
serviceId: string,
globalConfig?: boolean
): Promise<AmServiceSkeleton>;
deleteServiceNextDescendentOnly(
Copy link
Collaborator

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

@@ -124,7 +129,16 @@ export default (state: State): Service => {
): Promise<AmServiceSkeleton> {
return deleteFullService({ serviceId, globalConfig, state });
},

async deleteServiceNextDescendentOnly(
Copy link
Collaborator

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

@@ -590,6 +604,46 @@ export async function deleteFullService({
}
}

export async function deleteServiceNextDescentdentOnly({
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants