import cuid from 'cuid';
import User from '@/models/User';
import { database } from '@/config/firebase';

export default function Tipp(tipp = {}) {

  // Properties
  this.id = tipp.id || cuid();
  this.created = tipp.created || Date.now();
  this.user = tipp.user || new User();
  this.text = tipp.text || '';
  this.location = tipp.location || null;
  this.approved = tipp.approved || false;

  const ref = database.ref('/tipps');

  /**
   * Save a tipp to firebase
   */
  this.set = () => {
    return ref.set(JSON.parse(JSON.stringify(this)));
  };
};
@@ -419,16 +419,27 @@
 ref(
-'
+%60
 /tipps
-'
+/$%7Bthis.id%7D%60
 );%0A%0A
@@ -560,9 +560,9 @@
 ;%0A  %7D;%0A%7D
-;
+%0A

Fix tipp model ref