Skip to content

Commit

Permalink
fix: add visibility flag to insight page creation (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Nov 16, 2022
1 parent 0dbbd7f commit 2ddb855
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/insight/dtos/create-insight.dto.ts
@@ -1,5 +1,5 @@
import { ApiProperty } from "@nestjs/swagger";
import { IsArray, IsString } from "class-validator";
import { IsArray, IsBoolean, IsString } from "class-validator";

export class CreateInsightDto {
@ApiProperty({
Expand All @@ -10,6 +10,14 @@ export class CreateInsightDto {
@IsString()
name: string;

@ApiProperty({
description: "Insight Page Visibility",
type: Boolean,
example: false,
})
@IsBoolean()
is_public: boolean;

@ApiProperty({
description: "An array of repository IDs",
type: [Number],
Expand Down
1 change: 1 addition & 0 deletions src/insight/user-insight.controller.ts
Expand Up @@ -58,6 +58,7 @@ export class UserInsightsController {

const newInsight = await this.insightsService.addInsight({
name: createInsightDto.name,
is_public: createInsightDto.is_public,
user_id: userId,
});

Expand Down

0 comments on commit 2ddb855

Please sign in to comment.