Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Fix slugify
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jun 21, 2019
1 parent 8ec93c6 commit 0f52830
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "staart",
"version": "1.0.26",
"version": "1.0.27",
"main": "index.js",
"repository": "[email protected]:AnandChowdhary/staart.git",
"author": "Anand Chowdhary <[email protected]>",
Expand Down
7 changes: 3 additions & 4 deletions src/crud/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ export const createOrganization = async (organization: Organization) => {
organization.name = capitalizeFirstAndLastLetter(organization.name);
organization.createdAt = new Date();
organization.updatedAt = organization.createdAt;
organization.username = `${slugify(organization.name).replace(
"-s-",
"s-"
)}-${cryptoRandomString({ length: 5, type: "hex" })}`;
organization.username = `${slugify(organization.name, {
lower: true
}).replace(/'|"/g, "")}-${cryptoRandomString({ length: 5, type: "hex" })}`;
// Create organization
return await query(
`INSERT INTO organizations ${tableValues(organization)}`,
Expand Down
8 changes: 0 additions & 8 deletions src/rest/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ export const newOrganizationForUser = async (
userId,
role: MembershipRole.OWNER
});
await createNotification({
userId,
category: NotificationCategories.JOINED_ORGANIZATION,
text: `You created the organization **${
(await getOrganization(organizationId)).name
}**`,
link: "/settings/organizations"
});
await createEvent(
{
userId,
Expand Down

0 comments on commit 0f52830

Please sign in to comment.