diff --git a/.gitea/workflows/penerbitan.yml b/.gitea/workflows/penerbitan.yml index 178caf9..0a221eb 100644 --- a/.gitea/workflows/penerbitan.yml +++ b/.gitea/workflows/penerbitan.yml @@ -21,7 +21,6 @@ jobs: >> $GITEA_OUTPUT penerbitan: - if: "!contains(gitea.event.head_commit.message, 'Merge pull request')" runs-on: ubuntu-latest needs: persiapan steps: diff --git a/guest-js/index.ts b/guest-js/index.ts index b0a5f8a..349f377 100644 --- a/guest-js/index.ts +++ b/guest-js/index.ts @@ -1,20 +1,20 @@ import { invoke } from "@tauri-apps/api/core"; import { SBlueclasMuatanKirim, SBlueclasResponDaftarPerangkat } from "./models"; -export async function cek_izin(): Promise { - return await invoke("plugin:bluclas|cek_izin").then((r) => r); +export async function cekIzin(): Promise { + return await invoke("plugin:bluclas|cek_izin").then((res: string) => res); } -export async function minta_izin(): Promise { +export async function mintaIzin(): Promise { return await invoke("plugin:bluclas|minta_izin"); } -export async function daftar_perangkat(): Promise< +export async function daftarPerangkat(): Promise< SBlueclasResponDaftarPerangkat[] > { return await invoke( "plugin:bluclas|daftar_perangkat", - ).then((r) => (r.value ? r.value : null)); + ).then((res: SBlueclasResponDaftarPerangkat[]) => res); } export async function kirim(value: SBlueclasMuatanKirim): Promise { diff --git a/package.json b/package.json index af01436..10b933c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@segubi/tauri-plugin-bluclas-api", - "version": "0.1.0", + "version": "0.1.1", "author": "Rizky Denianto", "description": "", "type": "module", diff --git a/src/commands.rs b/src/commands.rs index a91c47d..bc5c9c9 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -5,7 +5,7 @@ use crate::Result; use crate::models::*; #[command] -pub(crate) async fn cek_izin(app: AppHandle) -> Result { +pub(crate) async fn cek_izin(app: AppHandle) -> Result { return app.bluclas().cek_izin(); } diff --git a/src/desktop.rs b/src/desktop.rs index fc61630..c188a48 100644 --- a/src/desktop.rs +++ b/src/desktop.rs @@ -14,8 +14,8 @@ pub fn init( pub struct Bluclas(AppHandle); impl Bluclas { - pub fn cek_izin(&self) -> crate::Result { - return Ok(false); + pub fn cek_izin(&self) -> crate::Result { + return Ok(String::new()); } pub fn minta_izin(&self) -> crate::Result<()> { diff --git a/src/mobile.rs b/src/mobile.rs index 41b88b8..363a0bd 100644 --- a/src/mobile.rs +++ b/src/mobile.rs @@ -25,7 +25,7 @@ pub fn init( pub struct Bluclas(PluginHandle); impl Bluclas { - pub fn cek_izin(&self) -> crate::Result { + pub fn cek_izin(&self) -> crate::Result { return self .0 .run_mobile_plugin("checkPermissions", ())