Updates
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
// @ts-check
|
||||
|
||||
import grabHostNames from "../utils/grab-host-names";
|
||||
|
||||
interface FunctionReturn {
|
||||
export interface DSQLUploadImageFunctionReturn {
|
||||
success: boolean;
|
||||
payload: {
|
||||
urlPath: string;
|
||||
urlThumbnailPath: string;
|
||||
} | null;
|
||||
payload: DSQLUploadImagePayload | null;
|
||||
msg?: string;
|
||||
}
|
||||
|
||||
export interface DSQLUploadImagePayload {
|
||||
urlPath: string;
|
||||
urlThumbnailPath: string;
|
||||
}
|
||||
|
||||
type Param = {
|
||||
key?: string;
|
||||
payload: {
|
||||
@@ -33,7 +33,7 @@ export default async function uploadImage({
|
||||
payload,
|
||||
user_id,
|
||||
useDefault,
|
||||
}: Param): Promise<FunctionReturn> {
|
||||
}: Param): Promise<DSQLUploadImageFunctionReturn> {
|
||||
const grabedHostNames = grabHostNames({ useDefault });
|
||||
const { host, port, scheme } = grabedHostNames;
|
||||
|
||||
@@ -90,7 +90,7 @@ export default async function uploadImage({
|
||||
httpsRequest.end();
|
||||
});
|
||||
|
||||
return httpResponse as FunctionReturn;
|
||||
return httpResponse as DSQLUploadImageFunctionReturn;
|
||||
} catch (error: any) {
|
||||
console.log("Error in uploading image: ", error.message);
|
||||
global.ERROR_CALLBACK?.(`Error Uploading Image`, error as Error);
|
||||
|
||||
Reference in New Issue
Block a user