removing public decorator in api

This commit is contained in:
2025-03-15 08:54:48 -05:00
parent 6a3e9267f2
commit d788ace47f
14 changed files with 901 additions and 605 deletions

View File

@@ -20,25 +20,24 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@azure/functions": "^1.0.3",
"@nestjs/axios": "^4.0.0",
"@nestjs/azure-func-http": "^0.10.0",
"@nestjs/common": "^10.0.0",
"@nestjs/config": "^4.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/common": "^11.0.11",
"@nestjs/config": "^4.0.1",
"@nestjs/core": "^11.0.11",
"@nestjs/platform-express": "^11.0.11",
"@noahspan/azure-database": "^3.1.2",
"@noahspan/noahspan-modules": "^1.0.0",
"@noahspan/noahspan-modules": "^1.1.5",
"axios": "^1.7.9",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.2",
"rxjs": "7.8.2",
"uuid": "^11.0.5"
},
"devDependencies": {
"@angular-devkit/schematics": "^19.1.4",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@nestjs/cli": "^11.0.5",
"@nestjs/schematics": "^11.0.2",
"@nestjs/testing": "^11.0.11",
"@schematics/angular": "^19.1.4",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",

View File

@@ -1,5 +1,5 @@
import { Module } from '@nestjs/common';
import { APP_FILTER, APP_GUARD } from '@nestjs/core';
import { APP_FILTER, APP_GUARD, Reflector } from '@nestjs/core';
import { HttpExceptionFilter } from './filters/http-exception.filter';
import { ProjectModule } from './project/project.module';
import { AuthGuard, AuthModule, UserModule } from '@noahspan/noahspan-modules'
@@ -39,10 +39,6 @@ import configuration from './config/configuration';
{
provide: APP_FILTER,
useClass: HttpExceptionFilter
},
{
provide: APP_GUARD,
useClass: AuthGuard
}
]
})

View File

@@ -12,13 +12,14 @@ import {
import { ProjectDto } from './project.dto';
import { Project } from './project.entity';
import { ProjectService } from './project.service';
import { CustomError, Public } from '@noahspan/noahspan-modules';
import { AuthGuard, CustomError, Public } from '@noahspan/noahspan-modules';
@Controller('projects')
export class ProjectController {
constructor(private readonly projectService: ProjectService) {}
@Get(':partitionKey/:rowKey')
@UseGuards(AuthGuard)
async find(
@Param('partitionKey') partitionKey: string,
@Param('rowKey') rowKey: string
@@ -32,12 +33,12 @@ export class ProjectController {
}
}
@Public()
@Get()
async findAll() {
try {
return await this.projectService.findAll();
} catch (error) {
console.log(error)
const customError = error as CustomError;
throw new HttpException(customError.message, customError.statusCode);
@@ -45,6 +46,7 @@ export class ProjectController {
}
@Post()
@UseGuards(AuthGuard)
async create(@Body() projectDto: ProjectDto) {
try {
const project = new Project();
@@ -60,6 +62,7 @@ export class ProjectController {
}
@Put(':partitionKey/:rowKey')
@UseGuards(AuthGuard)
async update(
@Param('partitionKey') partitionKey: string,
@Param('rowKey') rowKey: string,
@@ -79,6 +82,7 @@ export class ProjectController {
}
@Delete(':partitionKey/:rowKey')
@UseGuards(AuthGuard)
async delete(
@Param('partitionKey') partitionKey: string,
@Param('rowKey') rowKey: string

View File

@@ -1,7 +1,9 @@
import { EntityString } from '@noahspan/azure-database';
export class Project {
partitionKey: string;
rowKey: string;
displayName: string;
icon: string;
summary: string;
@EntityString() partitionKey: string;
@EntityString() rowKey: string;
@EntityString() displayName: string;
@EntityString() icon: string;
@EntityString() summary: string;
}

View File

@@ -17,7 +17,7 @@ import { ConfigModule, ConfigService } from '@nestjs/config';
inject: [ConfigService]
}),
AzureTableStorageModule.forFeature(Project, {
createTableIfNotExists: true,
createTableIfNotExists: false,
table: 'projects'
}),
],

View File

@@ -1,7 +1,6 @@
import { InjectRepository, Repository } from '@noahspan/azure-database';
import { Injectable } from '@nestjs/common';
import { Project } from './project.entity';
import { v4 as uuidv4 } from 'uuid';
@Injectable()
export class ProjectService {