mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-03-29 11:12:19 +01:00
Diffs. Cleanup.
This commit is contained in:
parent
ae3782bd15
commit
077bede063
@ -1,8 +1,8 @@
|
||||
--- template/app/src/file-upload/operations.ts
|
||||
+++ opensaas-sh/app/src/file-upload/operations.ts
|
||||
@@ -18,6 +18,18 @@
|
||||
throw new HttpError(401);
|
||||
}
|
||||
@@ -25,6 +25,18 @@
|
||||
|
||||
const args = ensureArgsSchemaOrThrowHttpError(createFileInputSchema, rawArgs);
|
||||
|
||||
+ const numberOfFilesByUser = await context.entities.File.count({
|
||||
+ where: {
|
||||
@ -16,6 +16,6 @@
|
||||
+ throw new HttpError(403, 'Thanks for trying Open SaaS. This demo only allows 2 file uploads per user.');
|
||||
+ }
|
||||
+
|
||||
const userInfo = context.user.id;
|
||||
|
||||
const { uploadUrl, key } = await getUploadFileSignedURLFromS3({ fileType, userInfo });
|
||||
const { uploadUrl, key } = await getUploadFileSignedURLFromS3({
|
||||
fileType: args.fileType,
|
||||
fileName: args.fileName,
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- template/app/src/payment/plans.ts
|
||||
+++ opensaas-sh/app/src/payment/plans.ts
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
export interface PaymentPlan {
|
||||
- // Returns the id under which this payment plan is identified on your payment processor.
|
||||
+ // Returns the id under which this payment plan is identified on your payment processor.
|
||||
// E.g. this might be price id on Stripe, or variant id on LemonSqueezy.
|
||||
getPaymentProcessorPlanId: () => string;
|
||||
effect: PaymentPlanEffect;
|
@ -1,8 +1,8 @@
|
||||
--- template/app/src/user/operations.ts
|
||||
+++ opensaas-sh/app/src/user/operations.ts
|
||||
@@ -38,7 +38,10 @@
|
||||
subscriptionStatus?: SubscriptionStatus[];
|
||||
@@ -41,7 +41,10 @@
|
||||
};
|
||||
|
||||
type GetPaginatedUsersOutput = {
|
||||
- users: Pick<User, 'id' | 'email' | 'username' | 'subscriptionStatus' | 'paymentProcessorUserId'>[];
|
||||
+ users: Pick<
|
||||
@ -12,20 +12,7 @@
|
||||
totalPages: number;
|
||||
};
|
||||
|
||||
@@ -51,8 +54,10 @@
|
||||
}
|
||||
|
||||
const allSubscriptionStatusOptions = args.subscriptionStatus as Array<string | null> | undefined;
|
||||
- const hasNotSubscribed = allSubscriptionStatusOptions?.find((status) => status === null)
|
||||
- let subscriptionStatusStrings = allSubscriptionStatusOptions?.filter((status) => status !== null) as string[] | undefined
|
||||
+ const hasNotSubscribed = allSubscriptionStatusOptions?.find((status) => status === null);
|
||||
+ let subscriptionStatusStrings = allSubscriptionStatusOptions?.filter((status) => status !== null) as
|
||||
+ | string[]
|
||||
+ | undefined;
|
||||
|
||||
const queryResults = await context.entities.User.findMany({
|
||||
skip: args.skip,
|
||||
@@ -65,6 +70,7 @@
|
||||
@@ -82,6 +85,7 @@
|
||||
mode: 'insensitive',
|
||||
},
|
||||
isAdmin: args.isAdmin,
|
||||
@ -33,7 +20,7 @@
|
||||
},
|
||||
{
|
||||
OR: [
|
||||
@@ -88,7 +94,7 @@
|
||||
@@ -105,7 +109,7 @@
|
||||
username: true,
|
||||
isAdmin: true,
|
||||
subscriptionStatus: true,
|
||||
@ -42,7 +29,7 @@
|
||||
},
|
||||
orderBy: {
|
||||
id: 'desc',
|
||||
@@ -104,6 +110,7 @@
|
||||
@@ -121,6 +125,7 @@
|
||||
mode: 'insensitive',
|
||||
},
|
||||
isAdmin: args.isAdmin,
|
||||
|
@ -3,6 +3,8 @@ import { createFile } from 'wasp/client/operations';
|
||||
import axios from 'axios';
|
||||
import { ALLOWED_FILE_TYPES, MAX_FILE_SIZE } from './validation';
|
||||
|
||||
type AllowedFileType = (typeof ALLOWED_FILE_TYPES)[number];
|
||||
type FileWithValidType = Omit<File, 'type'> & { type: AllowedFileType };
|
||||
interface FileUploadProgress {
|
||||
file: FileWithValidType;
|
||||
setUploadProgressPercent: Dispatch<SetStateAction<number>>;
|
||||
@ -28,9 +30,6 @@ export interface FileUploadError {
|
||||
code: 'NO_FILE' | 'INVALID_FILE_TYPE' | 'FILE_TOO_LARGE' | 'UPLOAD_FAILED';
|
||||
}
|
||||
|
||||
type AllowedFileType = (typeof ALLOWED_FILE_TYPES)[number];
|
||||
type FileWithValidType = Omit<File, 'type'> & { type: AllowedFileType };
|
||||
|
||||
type FileParseResult =
|
||||
| { kind: 'success'; file: FileWithValidType }
|
||||
| {
|
||||
|
Loading…
x
Reference in New Issue
Block a user