ringfinger/js/api/FingerprintPutApiRequest.ts

18 lines
630 B
TypeScript
Raw Permalink Normal View History

import ApiRequest from "./ApiRequest.js";
import Fingerprint from "../types/Fingerprint.js";
import RequestMethod from "./RequestMethod.js";
import FingerprintChangedEvent from "../event/FingerprintChangedEvent.js";
export default class FingerprintPutApiRequest extends ApiRequest
{
public constructor(fingerprint: Fingerprint) {
super('fingerprint/' + fingerprint.getFingerprintId(), RequestMethod.PUT);
this.addParameter('fingerprint', fingerprint.getFingerprint());
this.onSuccess = (responseText: string) => {
console.log(responseText);
window.dispatchEvent(new FingerprintChangedEvent(fingerprint));
};
}
}