Skip to content

Commit

Permalink
Add shortDescription field to a dApp data (#119)
Browse files Browse the repository at this point in the history
* Add shortDescription field to a dApp data

* Add shortDescription to register method
  • Loading branch information
bobo-k2 authored Nov 8, 2023
1 parent d95debd commit ee89249
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/controllers/DappsStakingController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export class DappsStakingController extends ControllerBase implements IControlle
app.route('/api/v1/:network/dapps-staking/register').post(
body('name').notEmpty().trim().escape(),
body('description').notEmpty().trim().escape(),
body('shortDescription').optional().trim().escape(),
body('url').isURL(),
body('license').notEmpty().trim().isIn(['GPL-3.0', 'MIT', 'GNU']),
body('address').notEmpty().trim().escape(),
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ app.use(cors());
const controllers: IControllerBase[] = container.getAll<IControllerBase>(ContainerTypes.Controller);
controllers.forEach((controller) => controller.register(app));

functions.runWith({ memory: '512MB' });
exports.app = functions.https.onRequest(app);
1 change: 1 addition & 0 deletions src/models/Dapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface DappItem {
contractType: string;
mainCategory: Category;
creationTime: number;
shortDescription?: string;
}

export interface NewDappItem extends DappItem {
Expand Down
3 changes: 2 additions & 1 deletion src/services/FirebaseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class FirebaseService implements IFirebaseService {
const query = admin
.firestore()
.collection(collectionKey)
.select('name', 'iconUrl', 'address', 'mainCategory', 'imagesUrl');
.select('name', 'iconUrl', 'address', 'mainCategory', 'imagesUrl', 'shortDescription');

return this.getDappsData(query);
}
Expand Down Expand Up @@ -109,6 +109,7 @@ export class FirebaseService implements IFirebaseService {
imagesUrl: dapp.imagesUrl,
developers: dapp.developers,
description: dapp.description,
shortDescription: dapp.shortDescription,
communities: dapp.communities,
contractType: dapp.contractType,
mainCategory: dapp.mainCategory,
Expand Down

0 comments on commit ee89249

Please sign in to comment.