mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-28 20:19:08 +00:00
FIX: pipeline accepting properties on payload
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Metadata } from '@grpc/grpc-js';
|
||||
|
||||
interface Info {
|
||||
interface IMetadata {
|
||||
customer_id?: string;
|
||||
customer_name?: string;
|
||||
username?: string;
|
||||
@@ -9,14 +9,11 @@ interface Info {
|
||||
details?: string;
|
||||
}
|
||||
|
||||
export const PackTheMetadata = (info: Info): Metadata => {
|
||||
export function PackTheMetadata(info: IMetadata): Metadata {
|
||||
const meta = new Metadata();
|
||||
meta.add('customer_id', info.customer_id);
|
||||
meta.add('customer_name', info.customer_name);
|
||||
meta.add('user_id', info.user_id);
|
||||
meta.add('username', info.username);
|
||||
meta.add('details', info.details);
|
||||
meta.add('language', info.language);
|
||||
for (const key in info) {
|
||||
meta.add(key, info[key]);
|
||||
}
|
||||
|
||||
return meta;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user