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:
@@ -51,6 +51,7 @@ exports.up = async function up(knex) {
|
||||
.defaultTo(knex.fn.now())
|
||||
.notNullable()
|
||||
.comment('The timestamp when this member joined');
|
||||
table.text('picture').comment('Link to profile picture');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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' });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user