34 lines
915 B
JavaScript
34 lines
915 B
JavaScript
import {API} from './API';
|
|
import {PermaLink} from '../../models/permalinks/permalink';
|
|
|
|
export class PermaLinkAPI extends API {
|
|
constructor(res, content, uid, endpoint, username, id) {
|
|
super();
|
|
this.res = res;
|
|
this.response = {
|
|
status: {
|
|
error: false,
|
|
code: 201,
|
|
type: 'created',
|
|
message: 'Success'
|
|
},
|
|
data: [
|
|
{
|
|
status: 'Resource created',
|
|
note: {
|
|
uid: uid,
|
|
endpoint: `/api/note/${endpoint}`,
|
|
content: content,
|
|
createdby: username,
|
|
id: id
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
endpoint() {
|
|
this.res.status(201).end(JSON.stringify(this.response, false, 4));
|
|
}
|
|
}
|