mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-03-29 11:12:19 +01:00
update app diff
This commit is contained in:
parent
9536481a82
commit
fe4381917e
@ -104,7 +104,7 @@
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -212,9 +208,9 @@
|
||||
@@ -207,9 +203,9 @@
|
||||
}
|
||||
|
||||
api paymentsWebhook {
|
||||
|
@ -1,9 +1,9 @@
|
||||
--- template/app/schema.prisma
|
||||
+++ opensaas-sh/app/schema.prisma
|
||||
@@ -14,10 +14,12 @@
|
||||
@@ -13,10 +13,12 @@
|
||||
|
||||
email String? @unique
|
||||
username String? @unique
|
||||
lastActiveTimestamp DateTime @default(now())
|
||||
- isAdmin Boolean @default(false)
|
||||
+ isAdmin Boolean @default(true)
|
||||
+ // isMockUser is an extra property for the demo app ensuring that all users can access
|
||||
|
@ -8,7 +8,7 @@
|
||||
const [isAdminFilter, setIsAdminFilter] = useState<boolean | undefined>(undefined);
|
||||
const [statusOptions, setStatusOptions] = useState<SubscriptionStatus[]>([]);
|
||||
const { data, isLoading, error } = useQuery(getPaginatedUsers, {
|
||||
@@ -222,7 +223,7 @@
|
||||
@@ -211,7 +212,7 @@
|
||||
<p className='text-sm text-black dark:text-white'>{user.subscriptionStatus}</p>
|
||||
</div>
|
||||
<div className='col-span-2 flex items-center'>
|
||||
|
@ -1,13 +1,13 @@
|
||||
--- template/app/src/server/scripts/dbSeeds.ts
|
||||
+++ opensaas-sh/app/src/server/scripts/dbSeeds.ts
|
||||
@@ -38,9 +38,11 @@
|
||||
@@ -37,9 +37,11 @@
|
||||
sendNewsletter: false,
|
||||
credits,
|
||||
subscriptionStatus,
|
||||
- lemonSqueezyCustomerPortalUrl: null,
|
||||
- paymentProcessorUserId: hasUserPaidOnStripe ? `cus_test_${faker.string.uuid()}` : null,
|
||||
+ stripeId: hasUserPaidOnStripe ? `cus_test_${faker.string.uuid()}` : null,
|
||||
datePaid: hasUserPaidOnStripe ? faker.date.between({ from: createdAt, to: lastActiveTimestamp }) : null,
|
||||
datePaid: hasUserPaidOnStripe ? faker.date.between({ from: createdAt, to: timePaid }) : null,
|
||||
subscriptionPlan: subscriptionStatus ? faker.helpers.arrayElement(getSubscriptionPaymentPlanIds()) : null,
|
||||
+ // For the demo app, we want to default isMockUser to true so that our admin dash only shows mock users
|
||||
+ // and not real users signing up to test the app
|
||||
|
@ -1,18 +1,18 @@
|
||||
--- template/app/src/user/operations.ts
|
||||
+++ opensaas-sh/app/src/user/operations.ts
|
||||
@@ -52,7 +52,10 @@
|
||||
@@ -38,7 +38,10 @@
|
||||
subscriptionStatus?: SubscriptionStatus[];
|
||||
};
|
||||
type GetPaginatedUsersOutput = {
|
||||
- users: Pick<User, 'id' | 'email' | 'username' | 'lastActiveTimestamp' | 'subscriptionStatus' | 'paymentProcessorUserId'>[];
|
||||
- users: Pick<User, 'id' | 'email' | 'username' | 'subscriptionStatus' | 'paymentProcessorUserId'>[];
|
||||
+ users: Pick<
|
||||
+ User,
|
||||
+ 'id' | 'email' | 'username' | 'lastActiveTimestamp' | 'subscriptionStatus' | 'stripeId'
|
||||
+ 'id' | 'email' | 'username' | 'subscriptionStatus' | 'stripeId'
|
||||
+ >[];
|
||||
totalPages: number;
|
||||
};
|
||||
|
||||
@@ -65,8 +68,10 @@
|
||||
@@ -51,8 +54,10 @@
|
||||
}
|
||||
|
||||
const allSubscriptionStatusOptions = args.subscriptionStatus as Array<string | null> | undefined;
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
const queryResults = await context.entities.User.findMany({
|
||||
skip: args.skip,
|
||||
@@ -79,6 +84,7 @@
|
||||
@@ -65,6 +70,7 @@
|
||||
mode: 'insensitive',
|
||||
},
|
||||
isAdmin: args.isAdmin,
|
||||
@ -33,16 +33,16 @@
|
||||
},
|
||||
{
|
||||
OR: [
|
||||
@@ -103,7 +109,7 @@
|
||||
@@ -88,7 +94,7 @@
|
||||
username: true,
|
||||
isAdmin: true,
|
||||
lastActiveTimestamp: true,
|
||||
subscriptionStatus: true,
|
||||
- paymentProcessorUserId: true,
|
||||
+ stripeId: true,
|
||||
},
|
||||
orderBy: {
|
||||
id: 'desc',
|
||||
@@ -119,6 +125,7 @@
|
||||
@@ -104,6 +110,7 @@
|
||||
mode: 'insensitive',
|
||||
},
|
||||
isAdmin: args.isAdmin,
|
||||
|
Loading…
x
Reference in New Issue
Block a user