add picture to avatar, lint fixes

Signed-off-by: Lykke Axlin <lykkeaxlin@hotmail.com>

Co-authored-by: klaraab <klarabroman@live.se>
This commit is contained in:
Lykke Axlin
2021-10-12 16:35:35 +02:00
parent 1fb1f8d758
commit af4fd48b0b
9 changed files with 18 additions and 43 deletions
@@ -50,11 +50,12 @@ export class DatabaseHandler {
.where({ entity_ref: entityRef });
}
async addMember(userId: any, entityRef: any) {
async addMember(userId: any, entityRef: any, picture?: string) {
await this.database
.insert({
entity_ref: entityRef,
user_id: userId,
picture: picture,
})
.into('public.members');
}
+2 -2
View File
@@ -52,8 +52,8 @@ export async function createRouter(
});
router.put('/member', async (request, response) => {
const { user_id, entity_ref } = request.body;
await dbHandler.addMember(user_id, entity_ref);
const { user_id, entity_ref, picture } = request.body;
await dbHandler.addMember(user_id, entity_ref, picture);
response.json({ status: 'ok' });
});