import { Injectable } from '@angular/core';
import Parse from 'parse';

@Injectable({
  providedIn: 'root'
})
export class ParseService {

  constructor() {
    this.initializeParse();
  }

  private initializeParse() {
    Parse.initialize('dev');
    Parse.serverURL = 'http://web2023.fmode.cn:9999/parse';
  }

  public async queryMovies(): Promise<any[]> {
    const YJMovies = Parse.Object.extend('YJMovies');
    const query = new Parse.Query(YJMovies);
    return query.find();
  }

}