mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Set language will be saved in the database of the user during registration
This commit is contained in:
parent
452bf4127c
commit
97dad41b27
@ -108,5 +108,9 @@ module.exports = {
|
||||
allowEmbedIframes: {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
language: {
|
||||
type: 'string',
|
||||
allow: [null],
|
||||
},
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ type Mutation {
|
||||
locationName: String
|
||||
about: String
|
||||
termsAndConditionsAgreedVersion: String!
|
||||
language: String
|
||||
): User
|
||||
AddEmailAddress(email: String!): EmailAddress
|
||||
VerifyEmailAddress(
|
||||
|
||||
@ -29,6 +29,8 @@ type User {
|
||||
|
||||
allowEmbedIframes: Boolean
|
||||
|
||||
language: String
|
||||
|
||||
friends: [User]! @relation(name: "FRIENDS", direction: "BOTH")
|
||||
friendsCount: Int! @cypher(statement: "MATCH (this)<-[: FRIENDS]->(r: User) RETURN COUNT(DISTINCT r)")
|
||||
|
||||
@ -169,6 +171,7 @@ type Mutation {
|
||||
termsAndConditionsAgreedVersion: String
|
||||
termsAndConditionsAgreedAt: String
|
||||
allowEmbedIframes: Boolean
|
||||
language: String
|
||||
): User
|
||||
|
||||
DeleteUser(id: ID!, resource: [Deletable]): User
|
||||
|
||||
@ -17,6 +17,7 @@ export default function create() {
|
||||
termsAndConditionsAgreedVersion: '0.0.1',
|
||||
termsAndConditionsAgreedAt: '2019-08-01T10:47:19.212Z',
|
||||
allowEmbedIframes: false,
|
||||
language: 'en',
|
||||
}
|
||||
defaults.slug = slugify(defaults.name, { lower: true })
|
||||
args = {
|
||||
|
||||
@ -85,6 +85,7 @@ describe('CreateUserAccount', () => {
|
||||
nonce: '666777',
|
||||
password: 'hellopassword',
|
||||
termsAndConditionsAgreedVersion: '0.0.2',
|
||||
language: 'en',
|
||||
},
|
||||
})
|
||||
expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
|
||||
|
||||
@ -154,10 +154,11 @@ export default {
|
||||
const { name, password, about } = this.formData
|
||||
const { email, nonce } = this
|
||||
const termsAndConditionsAgreedVersion = VERSION
|
||||
const language = this.$i18n.locale()
|
||||
try {
|
||||
await this.$apollo.mutate({
|
||||
mutation: SignupVerificationMutation,
|
||||
variables: { name, password, about, email, nonce, termsAndConditionsAgreedVersion },
|
||||
variables: { name, password, about, email, nonce, termsAndConditionsAgreedVersion, language },
|
||||
})
|
||||
this.response = 'success'
|
||||
setTimeout(() => {
|
||||
|
||||
@ -7,6 +7,7 @@ export const SignupVerificationMutation = gql`
|
||||
$password: String!
|
||||
$about: String
|
||||
$termsAndConditionsAgreedVersion: String!
|
||||
$language: String
|
||||
) {
|
||||
SignupVerification(
|
||||
nonce: $nonce
|
||||
@ -15,6 +16,7 @@ export const SignupVerificationMutation = gql`
|
||||
password: $password
|
||||
about: $about
|
||||
termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion
|
||||
language: $language
|
||||
) {
|
||||
id
|
||||
name
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user