diff --git a/package.json b/package.json index 222925872..7ee5c0357 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "staart", - "version": "1.0.26", + "version": "1.0.27", "main": "index.js", "repository": "git@github.com:AnandChowdhary/staart.git", "author": "Anand Chowdhary ", diff --git a/src/crud/organization.ts b/src/crud/organization.ts index b7d65e87e..ac9916791 100644 --- a/src/crud/organization.ts +++ b/src/crud/organization.ts @@ -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)}`, diff --git a/src/rest/organization.ts b/src/rest/organization.ts index 7f5e957e5..7d7952234 100644 --- a/src/rest/organization.ts +++ b/src/rest/organization.ts @@ -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,