Can disable couple photos (#5)
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			Add an option in family settings to disable couple photos from Web UI Reviewed-on: #5
This commit is contained in:
		@@ -83,6 +83,14 @@ export class Family implements FamilyAPI {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export class ExtendedFamilyInfo extends Family {
 | 
			
		||||
  public disable_couple_photos: boolean;
 | 
			
		||||
  constructor(p: any) {
 | 
			
		||||
    super(p);
 | 
			
		||||
    this.disable_couple_photos = p.disable_couple_photos;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export enum JoinFamilyResult {
 | 
			
		||||
  TooManyRequests,
 | 
			
		||||
  InvalidCode,
 | 
			
		||||
@@ -152,13 +160,13 @@ export class FamilyApi {
 | 
			
		||||
  /**
 | 
			
		||||
   * Get information about a single family
 | 
			
		||||
   */
 | 
			
		||||
  static async GetSingle(id: number): Promise<Family> {
 | 
			
		||||
  static async GetSingle(id: number): Promise<ExtendedFamilyInfo> {
 | 
			
		||||
    const res = await APIClient.exec({
 | 
			
		||||
      method: "GET",
 | 
			
		||||
      uri: `/family/${id}`,
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    return new Family(res.data);
 | 
			
		||||
    return new ExtendedFamilyInfo(res.data);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
@@ -222,12 +230,14 @@ export class FamilyApi {
 | 
			
		||||
  static async UpdateFamily(settings: {
 | 
			
		||||
    id: number;
 | 
			
		||||
    name: string;
 | 
			
		||||
    disable_couple_photos: boolean;
 | 
			
		||||
  }): Promise<void> {
 | 
			
		||||
    await APIClient.exec({
 | 
			
		||||
      method: "PATCH",
 | 
			
		||||
      uri: `/family/${settings.id}`,
 | 
			
		||||
      jsonData: {
 | 
			
		||||
        name: settings.name,
 | 
			
		||||
        disable_couple_photos: settings.disable_couple_photos,
 | 
			
		||||
      },
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user