bugfixing: register user with free trial

This commit is contained in:
MuslemRahimi 2024-06-20 21:48:27 +02:00
parent f6a00edb9d
commit 687723f94e
11 changed files with 67 additions and 11 deletions

View File

@ -55,7 +55,12 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);

View File

@ -55,7 +55,12 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);

View File

@ -72,7 +72,12 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);

View File

@ -54,7 +54,12 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);

View File

@ -55,7 +55,12 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);

View File

@ -55,7 +55,12 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);

View File

@ -52,7 +52,12 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);

View File

@ -64,7 +64,12 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);

View File

@ -58,7 +58,12 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);

View File

@ -53,7 +53,13 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);

View File

@ -54,7 +54,12 @@ export const actions = {
try {
await locals.pb.collection('users').create(formData);
let newUser = await locals.pb.collection('users').create(formData);
await locals.pb?.collection('users').update(
newUser?.id, {
'freeTrial' : true,
'tier': 'Pro', //Give new users a free trial for the Pro Subscription
});
await locals.pb.collection('users').requestVerification(formData.email);
} catch (err) {
console.log('Error: ', err);