add: profiles.all()
This commit is contained in:
23
frontend/static/js/api/profiles.js
Normal file
23
frontend/static/js/api/profiles.js
Normal file
@ -0,0 +1,23 @@
|
||||
import { Profile } from "./profile.js";
|
||||
|
||||
class Profiles
|
||||
{
|
||||
constructor (client)
|
||||
{
|
||||
this.client = client
|
||||
}
|
||||
|
||||
async all()
|
||||
{
|
||||
let response = await this.client._get("/api/profiles/");
|
||||
let response_data = await response.json();
|
||||
|
||||
let profiles = []
|
||||
response_data.forEach((profile) => {
|
||||
profiles.push(new Profile(this.client, profile.username, profile.avatar_url, profile.user_id))
|
||||
});
|
||||
console.log(profiles);
|
||||
}
|
||||
}
|
||||
|
||||
export {Profiles}
|
Reference in New Issue
Block a user