Skip to content

Commit

Permalink
Merge pull request #167 from bcgov/dev
Browse files Browse the repository at this point in the history
chore: release
  • Loading branch information
NithinKuruba authored Aug 1, 2024
2 parents ca9d1a0 + c65c406 commit d38c8e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions app/__tests__/api/delete-realm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import githubResponseHandler from '../../pages/api/realms/pending';
import prisma from 'utils/prisma';
import { CustomRealmProfiles } from '../fixtures';
import { getServerSession } from 'next-auth';
import { createCustomRealmPullRequest, mergePullRequest, deleteBranch } from 'utils/github';
import { createCustomRealmPullRequest, mergePullRequest } from 'utils/github';
import { EventEnum, StatusEnum } from 'validators/create-realm';
import { removeUserAsRealmAdmin } from 'controllers/keycloak';
import { sendDeletionCompleteEmail } from 'utils/mailer';
Expand Down Expand Up @@ -97,14 +97,12 @@ describe('Realm Delete Request', () => {
expect(res.statusCode).toBe(401);
expect(createCustomRealmPullRequest).not.toHaveBeenCalled();
expect(mergePullRequest).not.toHaveBeenCalled();
expect(deleteBranch).not.toHaveBeenCalled();

mockAdminSession();
await deleteHandler(req, res);
expect(res.statusCode).toBe(200);
expect(createCustomRealmPullRequest).toHaveBeenCalled();
expect(mergePullRequest).toHaveBeenCalled();
expect(deleteBranch).toHaveBeenCalled();
});

it('Updates the status, archived, and prNumber when deleted successfully', async () => {
Expand Down
3 changes: 2 additions & 1 deletion app/pages/api/realms/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
return res.status(500).send('Unexpected error removing request. Please try again.');
}

await deleteBranch(realm.realm!);
// handled by github repo settings
//await deleteBranch(realm.realm!);
await Promise.all([
prisma.roster.update({
data: {
Expand Down

0 comments on commit d38c8e9

Please sign in to comment.