@devline-smart-taxi/common 2.3.73 → 2.3.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export interface CurrentUserType {
|
|
2
2
|
id: string;
|
|
3
3
|
role: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
4
|
+
branchId?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const CurrentUser: (...dataOrPipes: (keyof CurrentUserType | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
|
|
@@ -8,9 +8,11 @@ exports.CurrentUser = (0, common_1.createParamDecorator)((data, context) => {
|
|
|
8
8
|
// Canonical keys are user-*.
|
|
9
9
|
const id = metadata.get('user-id')?.[0];
|
|
10
10
|
const role = metadata.get('user-role')?.[0];
|
|
11
|
+
const branchId = metadata.get('user-branch-id')?.[0];
|
|
11
12
|
const user = {
|
|
12
13
|
id,
|
|
13
14
|
role,
|
|
15
|
+
branchId,
|
|
14
16
|
};
|
|
15
17
|
return data ? user?.[data] : user;
|
|
16
18
|
});
|