mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Assume `undefined` instead of `null` for project in terms of interfacing with segments: If the `project` field is not present, that means that it is not set, which means we're dealing with a "global" segment. If we want to unset `project` and make a segment global, we simply don't send the `project` property on our PUT method.
		
			
				
	
	
		
			17 lines
		
	
	
		
			329 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			329 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { IConstraint } from './strategy';
 | |
| 
 | |
| export interface ISegment {
 | |
|     id: number;
 | |
|     name: string;
 | |
|     description: string;
 | |
|     project?: string;
 | |
|     createdAt: string;
 | |
|     createdBy: string;
 | |
|     constraints: IConstraint[];
 | |
| }
 | |
| 
 | |
| export type ISegmentPayload = Pick<
 | |
|     ISegment,
 | |
|     'name' | 'description' | 'constraints'
 | |
| >;
 |