Skip to content
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

Remove unused files and packages leading to deprecated warning #1936

Closed
Closed
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
61d4122
Replace package vm2 with isolated-vm (#1532)
Community-Programmer Dec 22, 2023
46771db
chore(deps): bump follow-redirects from 1.15.3 to 1.15.4 (#1668)
dependabot[bot] Jan 11, 2024
2ae1594
chore(deps): bump vite from 3.2.7 to 3.2.8 (#1724)
dependabot[bot] Jan 20, 2024
4f0bd30
Update README.md
palisadoes Jan 21, 2024
fd83f2d
Update pull-request.yml
palisadoes Jan 29, 2024
8a0a2e4
Update INSTALLATION.md
Cioppolo14 Jan 31, 2024
ffdd784
Update pull-request-target.yml
Cioppolo14 Feb 7, 2024
1a73dda
chore(deps): bump nodemailer from 6.9.6 to 6.9.9 (#1808)
dependabot[bot] Feb 7, 2024
207f946
Update README.md
palisadoes Feb 12, 2024
86c8821
removed unused package: image-hash and pm2
pranshugupta54 Mar 3, 2024
1d62a4f
Merge branch 'PalisadoesFoundation:develop' into develop
pranshugupta54 Mar 3, 2024
be47fac
Merge branch 'develop' into develop
pranshugupta54 Mar 3, 2024
ffa288a
fixed test
pranshugupta54 Mar 3, 2024
437127f
Merge branch 'develop' of https://github.com/pranshugupta54/talawa-ap…
pranshugupta54 Mar 3, 2024
af4228e
Merge remote-tracking branch 'upstream' into develop
pranshugupta54 Mar 4, 2024
3a38a45
Update dependencies and remove unnecessary instructions in INSTALLATI…
pranshugupta54 Mar 4, 2024
de9860a
Merge branch 'develop' into develop
pranshugupta54 Mar 4, 2024
07efcbb
Merge branch 'develop' into develop
pranshugupta54 Mar 5, 2024
6abd65b
Merge branch 'develop' into develop
palisadoes Mar 6, 2024
6171abf
Merge branch 'PalisadoesFoundation:develop' into develop
pranshugupta54 Mar 9, 2024
debd4dd
Added pm2
pranshugupta54 Mar 9, 2024
aedc5ed
yml fix
pranshugupta54 Mar 9, 2024
0eecfda
yml fix
pranshugupta54 Mar 9, 2024
bf6ca94
Merge pull request #3 from PalisadoesFoundation/develop
pranshugupta54 Mar 11, 2024
b97bc21
Merge branch 'develop' into develop
pranshugupta54 Mar 13, 2024
4b18bb3
Merge branch 'develop' into develop
pranshugupta54 Mar 13, 2024
7f86cea
Update index.ts
pranshugupta54 Mar 14, 2024
91577ea
Merge branch 'develop' into develop
pranshugupta54 Mar 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
474 changes: 14 additions & 460 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"graphql-ws": "^5.14.2",
"helmet": "^7.1.0",
"i18n": "^0.15.1",
"image-hash": "^5.3.1",
"ioredis": "^5.3.2",
"jsonwebtoken": "^9.0.0",
"jwt-decode": "^4.0.0",
Expand All @@ -82,9 +81,9 @@
"mongoose": "^5.13.21",
"mongoose-paginate-v2": "^1.7.0",
"morgan": "^1.10.0",
"nanoid": "^5.0.5",
"nanoid": "^5.0.6",
"nodemailer": "^6.9.12",
"pm2": "^5.2.0",
"pm2": "^5.3.1",
"redis": "^4.6.13",
"rrule": "^2.8.1",
"typedoc-plugin-markdown": "^3.17.1",
Expand Down
2 changes: 0 additions & 2 deletions src/resolvers/Mutation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ import { removeUserCustomData } from "./removeUserCustomData";
import { removeUserFamily } from "./removeUserFamily";
import { removeUserFromGroupChat } from "./removeUserFromGroupChat";
import { removeUserFromUserFamily } from "./removeUserFromUserFamily";
import { removeUserImage } from "./removeUserImage";
import { removeUserTag } from "./removeUserTag";
import { resetCommunity } from "./resetCommunity";
import { revokeRefreshTokenForUser } from "./revokeRefreshTokenForUser";
Expand Down Expand Up @@ -202,7 +201,6 @@ export const Mutation: MutationResolvers = {
removePost,
removeUserCustomData,
removeUserFromGroupChat,
removeUserImage,
removeUserTag,
resetCommunity,
revokeRefreshTokenForUser,
Expand Down
17 changes: 11 additions & 6 deletions src/resolvers/Mutation/removeOrganizationImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import {
import type { MutationResolvers } from "../../types/generatedGraphQLTypes";
import { errors, requestContext } from "../../libraries";
import { Organization } from "../../models";
import { adminCheck, deleteImage } from "../../utilities";
import { adminCheck, deletePreviousImage } from "../../utilities";
import { findOrganizationsInCache } from "../../services/OrganizationCache/findOrganizationsInCache";
import { cacheOrganizations } from "../../services/OrganizationCache/cacheOrganizations";
/**
* This function enables to remove an organization's image.
* @param _parent - parent of current request
* @param args - payload provided with the request
* @param context - context of entire application
* @remarks The following checks are done:
* 1. If the user exists.
Expand All @@ -34,7 +33,9 @@ export const removeOrganizationImage: MutationResolvers["removeOrganizationImage
_id: args.organizationId,
}).lean();

await cacheOrganizations([organization!]);
if (organization) {
await cacheOrganizations([organization]);
}
}

// Checks whether organization exists.
Expand All @@ -58,9 +59,10 @@ export const removeOrganizationImage: MutationResolvers["removeOrganizationImage
);
}

await deleteImage(organization.image);

// Sets image field of organization to null and returns the updated organization.
if (organization?.image) {
await deletePreviousImage(organization?.image);
}
const updatedOrganization = await Organization.findOneAndUpdate(
{
_id: organization._id,
Expand All @@ -79,5 +81,8 @@ export const removeOrganizationImage: MutationResolvers["removeOrganizationImage
await cacheOrganizations([updatedOrganization]);
}

return updatedOrganization!;
if (!updatedOrganization) {
throw new Error("Organization could not be updated");
}
return updatedOrganization;
};
62 changes: 0 additions & 62 deletions src/resolvers/Mutation/removeUserImage.ts

This file was deleted.

61 changes: 0 additions & 61 deletions src/utilities/deleteImage.ts

This file was deleted.

5 changes: 4 additions & 1 deletion src/utilities/encodedImageStorage/deletePreviousImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import { EncodedImage } from "../../models/EncodedImage";
export const deletePreviousImage = async (
imageToBeDeletedPath: string,
): Promise<void> => {
if (!imageToBeDeletedPath) {
throw new Error("imageToBeDeletedPath is null or undefined");
}
const imageToBeDeleted = await EncodedImage.findOne({
fileName: imageToBeDeletedPath!,
fileName: imageToBeDeletedPath,
});

if (imageToBeDeleted?.numberOfUses === 1) {
Expand Down
85 changes: 0 additions & 85 deletions src/utilities/imageAlreadyInDbCheck.ts

This file was deleted.

31 changes: 0 additions & 31 deletions src/utilities/imageExtensionCheck.ts

This file was deleted.

5 changes: 2 additions & 3 deletions src/utilities/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export * from "./adminCheck";
export * from "./auth";
export * from "./copyToClipboard";
export * from "./deleteImage";
export * from "./mailer";
export * from "./superAdminCheck";
export * from "./uploadImage";
export * from "./isAuthCheck";
export * from "./encodedImageStorage/deletePreviousImage";
export * from "./isAuthCheck";
Loading
Loading