Skip to content

Commit

Permalink
feat: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
prc5 committed Oct 1, 2024
1 parent 7e59e19 commit f5cd8f4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions packages/adapter-firebase-admin/src/adapter/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const FirebaseAdminAdapter =
});
return new Promise<ResponseType<any, any, any>>((resolve) => {
if (database instanceof Firestore) {
const { method = FirestoreMethods.getDocs, queryParams, data, options } = request as FirestoreRequestType;
const { method = FirestoreMethods.getDocs, queryParams, payload, options } = request as FirestoreRequestType;
const availableMethods = getFirestoreAdminMethods(database, fullUrl, onSuccess, onError, resolve, {
onRequestStart,
onResponseEnd,
Expand All @@ -39,11 +39,11 @@ export const FirebaseAdminAdapter =
}
availableMethods(method, {
constraints: queryParams?.constraints ? queryParams.constraints : [],
data,
payload,
options,
});
} else {
const { method = RealtimeDBMethods.get, queryParams, data, options } = request as RealtimeDBRequestType;
const { method = RealtimeDBMethods.get, queryParams, payload, options } = request as RealtimeDBRequestType;
const availableMethods = getRealtimeDbAdminMethods(database, fullUrl, onSuccess, onError, resolve, {
onRequestStart,
onResponseEnd,
Expand All @@ -56,7 +56,7 @@ export const FirebaseAdminAdapter =
availableMethods(method, {
constraints: queryParams?.constraints ? queryParams.constraints : [],
options,
data,
payload,
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const getFirestoreAdminMethods = <T extends FirebaseAdminDBTypes>(
methodName: FirestoreMethodsUnion,
data: {
constraints?: PermittedConstraints<FirestorePermittedMethods, FirestoreConstraintsUnion | SharedQueryConstraints>[];
data?: any;
payload?: any;
options?: Record<string, any>;
},
) => Promise<void>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const getRealtimeDbAdminMethods = <T extends FirebaseAdminDBTypes>(
methodName: RealtimeDBMethodsUnion,
data: {
constraints: PermittedConstraints<RealtimePermittedMethods, RealtimeConstraintsUnion | SharedQueryConstraints>[];
data: any;
payload: any;
options: Record<string, any>;
},
) => Promise<void>) => {
Expand Down
8 changes: 4 additions & 4 deletions packages/adapter-firebase/src/adapter/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const FirebaseAdapter = <T extends FirebaseDBTypes>(database: T) => {
});
return new Promise<ResponseType<any, any, any>>((resolve) => {
if (database instanceof Database) {
const { method = RealtimeDBMethods.get, queryParams, data, options } = request as FirebaseRealtimeDBType;
const { method = RealtimeDBMethods.get, queryParams, payload, options } = request as FirebaseRealtimeDBType;
const availableMethods = getRealtimeDbBrowserMethods(database, fullUrl, onSuccess, onError, resolve, {
onResponseStart,
onResponseEnd,
Expand All @@ -40,10 +40,10 @@ export const FirebaseAdapter = <T extends FirebaseDBTypes>(database: T) => {
availableMethods(method, {
constraints: queryParams?.constraints || [],
options,
data,
payload,
});
} else {
const { method = FirestoreMethods.getDocs, queryParams, data, options } = request as FirestoreRequestType;
const { method = FirestoreMethods.getDocs, queryParams, payload, options } = request as FirestoreRequestType;
const availableMethods = getFirestoreBrowserMethods(database, fullUrl, onSuccess, onError, resolve, {
onResponseStart,
onResponseEnd,
Expand All @@ -56,7 +56,7 @@ export const FirebaseAdapter = <T extends FirebaseDBTypes>(database: T) => {
}
availableMethods(method, {
constraints: queryParams?.constraints ? queryParams.constraints : [],
data,
payload,
options,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const getFirestoreBrowserMethods = <T extends FirebaseDBTypes>(
methodName: FirestoreMethodsUnion,
data: {
constraints?: PermittedConstraints<FirestorePermittedMethods, FirestoreConstraintsUnion | SharedQueryConstraints>[];
data?: any;
payload?: any;
options?: Record<string, any>;
},
) => Promise<void>) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-firebase/src/realtime/realtime.methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const getRealtimeDbBrowserMethods = <T extends FirebaseDBTypes>(
methodName: RealtimeDBMethodsUnion,
data: {
constraints: PermittedConstraints<RealtimePermittedMethods, RealtimeConstraintsUnion | SharedQueryConstraints>[];
data: any;
payload: any;
options: Record<string, any>;
},
) => Promise<void>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const NetworkDetails = () => {
if (!item) return null;

const values = item.request.toJSON();
delete values.data;
delete values.payload;
delete values.params;
delete values.queryParams;
delete values.headers;
Expand Down

0 comments on commit f5cd8f4

Please sign in to comment.