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

Fixes #3558 NoMongo: Postgres Migration Support for Settings in orgDashboard #3597

Draft
wants to merge 3 commits into
base: develop-postgres
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
26 changes: 11 additions & 15 deletions src/GraphQl/Mutations/OrganizationMutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ export const TOGGLE_PINNED_POST = gql`
*/

export const ADD_CUSTOM_FIELD = gql`
mutation ($organizationId: ID!, $type: String!, $name: String!) {
addOrganizationCustomField(
organizationId: $organizationId
type: $type
name: $name
) {
name
type
mutation CreateCustomField($input: CreateCustomFieldInput!) {
createCustomField(input: $input) {
customField {
id
name
type
organizationId
}
}
}
`;
Expand All @@ -258,13 +258,9 @@ export const ADD_CUSTOM_FIELD = gql`
*/

export const REMOVE_CUSTOM_FIELD = gql`
mutation ($organizationId: ID!, $customFieldId: ID!) {
removeOrganizationCustomField(
organizationId: $organizationId
customFieldId: $customFieldId
) {
type
name
mutation DeleteCustomField($id: ID!) {
deleteCustomField(id: $id) {
success
}
}
`;
Expand Down
109 changes: 48 additions & 61 deletions src/GraphQl/Mutations/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,20 @@ export const ACCEPT_ORGANIZATION_REQUEST_MUTATION = gql`
// to update the organization details

export const UPDATE_ORGANIZATION_MUTATION = gql`
mutation UpdateOrganization(
$id: ID!
$name: String
$description: String
$address: AddressInput
$userRegistrationRequired: Boolean
$visibleInSearch: Boolean
$file: String
) {
updateOrganization(
id: $id
data: {
name: $name
description: $description
userRegistrationRequired: $userRegistrationRequired
visibleInSearch: $visibleInSearch
address: $address
}
file: $file
) {
_id
mutation UpdateOrganization($input: MutationUpdateOrganizationInput!) {
updateOrganization(input: $input) {
id
name
description
addressLine1
addressLine2
city
state
postalCode
countryCode
avatarMimeType
avatarURL
updatedAt
}
}
`;
Expand All @@ -83,43 +76,36 @@ export const ADDRESS_DETAILS_FRAGMENT = gql`
// to update the details of the user

export const UPDATE_USER_MUTATION = gql`
mutation UpdateUserProfile(
$firstName: String
$lastName: String
$gender: Gender
$email: EmailAddress
$phoneNumber: PhoneNumber
$birthDate: Date
$grade: EducationGrade
$empStatus: EmploymentStatus
$maritalStatus: MaritalStatus
$address: String
$state: String
$country: String
$image: String
$appLanguageCode: String
) {
updateUserProfile(
data: {
firstName: $firstName
lastName: $lastName
gender: $gender
email: $email
phone: { mobile: $phoneNumber }
birthDate: $birthDate
educationGrade: $grade
employmentStatus: $empStatus
maritalStatus: $maritalStatus
address: { line1: $address, state: $state, countryCode: $country }
appLanguageCode: $appLanguageCode
}
file: $image
) {
_id
mutation UpdateCurrentUser($input: MutationUpdateCurrentUserInput!) {
updateCurrentUser(input: $input) {
addressLine1
addressLine2
avatarMimeType
avatarURL
birthDate
city
countryCode
createdAt
description
educationGrade
emailAddress
employmentStatus
homePhoneNumber
id
isEmailAddressVerified
maritalStatus
mobilePhoneNumber
name
natalSex
naturalLanguageCode
postalCode
role
state
updatedAt
workPhoneNumber
}
}
`;

// to update the password of user

export const UPDATE_USER_PASSWORD_MUTATION = gql`
Expand Down Expand Up @@ -263,15 +249,15 @@ export const CREATE_ORGANIZATION_MEMBERSHIP_MUTATION_PG = gql`
// to delete the organization

export const DELETE_ORGANIZATION_MUTATION = gql`
mutation RemoveOrganization($id: ID!) {
removeOrganization(id: $id) {
user {
_id
}
mutation DeleteOrganization($input: MutationDeleteOrganizationInput!) {
deleteOrganization(input: $input) {
id
name
}
}
`;


// to create the event by any organization

export const CREATE_EVENT_MUTATION = gql`
Expand Down Expand Up @@ -770,10 +756,11 @@ export {

// Changes the role of a user in an organization
export {
ADD_CUSTOM_FIELD,
CREATE_SAMPLE_ORGANIZATION_MUTATION,
JOIN_PUBLIC_ORGANIZATION,
PLUGIN_SUBSCRIPTION,
// These should come from OrganizationMutations.ts
ADD_CUSTOM_FIELD,
REMOVE_CUSTOM_FIELD,
REMOVE_SAMPLE_ORGANIZATION_MUTATION,
SEND_MEMBERSHIP_REQUEST,
Expand Down
10 changes: 8 additions & 2 deletions src/GraphQl/Queries/PlugInQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,15 @@ export const CHATS_LIST = gql`
* @returns A boolean indicating whether the organization is a sample organization.
*/

// Ensure query matches backend schema
export const IS_SAMPLE_ORGANIZATION_QUERY = gql`
query ($isSampleOrganizationId: ID!) {
isSampleOrganization(id: $isSampleOrganizationId)
query Organization($id: String!) {
organization(input: { id: $id }) {
id
name
description
isSampleOrganization
}
}
`;

Expand Down
Loading
Loading