Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
article.js 526 B
Newer Older
"use strict";

class Article {
    constructor(data) {
        if (data) {
            this.from(data)
        } else {
            this.title = "";
            this.subtitle = "";
            this.category = "";
            this.details = [];
            this.images = [];
            this.body = "";
            this.locale = "";
        }
    }

    from(data) {
        Object.entries(data).forEach(k_v => {
            const [key, value] = k_v;
            this[key] = value;
        });
    }
}
module.exports = Article;