vikunja-frontend/src/models/user.js

24 lines
454 B
JavaScript
Raw Normal View History

import AbstractModel from './abstractModel'
export default class UserModel extends AbstractModel {
constructor(data) {
super(data)
this.created = new Date(this.created)
this.updated = new Date(this.updated)
}
defaults() {
return {
id: 0,
2019-06-06 12:52:05 +02:00
avatarUrl: '',
email: '',
username: '',
created: null,
updated: null,
}
}
getAvatarUrl(size = 50) {
return `https://www.gravatar.com/avatar/${this.avatarUrl}?s=${size}&d=mp`
}
}