Skip to content

Commit

Permalink
EMIT ADDED
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal Web committed Aug 10, 2023
1 parent 010e9bf commit ba59f0d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
16 changes: 0 additions & 16 deletions udsp/client/emit.js

This file was deleted.

2 changes: 1 addition & 1 deletion udsp/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
import { getCertificate, parseCertificate } from '#certificate';
import { watch } from '#watch';
// Client specific imports to extend class
import { emit } from './emit.js';
import { emit } from '../emit.js';
import { request } from '#udsp/request';
import { cryptography } from '#udsp/cryptography';
import { processMessage } from './processMessage.js';
Expand Down
16 changes: 16 additions & 0 deletions udsp/emit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {
success, failed, imported, msgSent, info
} from '#logs';
import { promise, construct, isString } from '@universalweb/acid';
imported('Request');
// To send a request but only receive AN ACKNOWLEDGEMENT
export async function emit(url, data, options = {}) {
info(`emit => ${url}`);
options.method = 'post';
const source = {
url,
data
};
const request = await this.request(source, options);
return request.send();
}
2 changes: 1 addition & 1 deletion udsp/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function post(url, data, options = {}) {
options.method = 'post';
const source = {
url,
data,
data
};
const request = await this.request(source, options);
return request.send();
Expand Down

0 comments on commit ba59f0d

Please sign in to comment.